Commit Graph

146 Commits

Author SHA1 Message Date
Cliff Frey
7239788205 pass pointer to settings structure rather than pass by value 2010-05-11 12:12:23 -07:00
Ryan Dahl
7cfa645fc7 Fix long chunked message bug
The HTTP_MAX_HEADER_SIZE was being consulted at the end of the chunked
message (when you look for trailing headers).

http://github.com/ry/node/issues#issue/77
2010-04-28 23:21:49 -07:00
Ryan Dahl
88d11b394d Support Upgrade header 2010-04-14 03:17:11 -07:00
Ryan Dahl
da30924dc8 Use stddef.h 2010-03-10 19:52:42 -08:00
Ryan Dahl
a458431e38 Remove string.h include 2010-02-27 21:27:13 -08:00
Ryan Dahl
e07e0b952e Tasteful vertical whitespace. 2010-02-27 21:24:09 -08:00
Ryan Dahl
4bce6b4467 Use nginx-style method compare
If only just to remove dependency on strncmp().
2010-02-27 21:18:08 -08:00
Ryan Dahl
dbd2dad461 Introduce http_parser_settings 2010-02-27 20:31:05 -08:00
Ryan Dahl
ef14734f6c Use marcros instead of inline funcs to do callbacks
Simplifies things.
2010-02-27 20:14:34 -08:00
Ryan Dahl
8243fddd17 Fix c++ and mac compile errors 2010-02-20 17:10:22 -08:00
Ryan Dahl
1b30bf4ba5 Only allow 80kb of header bytes 2010-02-02 16:41:45 -08:00
Cliff Frey
d5a900264f Allow newlines before HTTP requests.
I have seen cases where a browser will POST data, and then send an
extra CRLF before issuing the next request.
2010-02-02 09:17:19 -08:00
Cliff Frey
f167565742 Allow '_' in header fields.
Technically anything defined as a 'token' by
http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 should be
allowed, which includes !#$%^&*+-.`~| and probably others.  However
this is the only one that I have found in use.
2010-02-02 09:15:48 -08:00
Cliff Frey
6409a5bd17 Allow extra '?' in query strings, and add a test for it. 2010-02-02 09:14:39 -08:00
Cliff Frey
ae8234de93 Prevent uninitialized variable use 2010-02-02 09:14:15 -08:00
Ryan Dahl
9cbd66e49a Support 'Proxy-Connection' header
See http://www.http-stats.com/Proxy-Connection
2010-01-09 01:16:19 -08:00
Ryan Dahl
caef58793e Update license for 2010 2010-01-08 21:42:02 -08:00
Ryan Dahl
1a677040c0 API: Define parser type in http_parser_init()
That is, for a request parser do this:

  http_parser_init(my_parser, HTTP_REQUEST)

for a response parser do this:

  http_parser_init(my_parser, HTTP_RESPONSE)

Then http_parse_requests() and http_parse_responses() both turn
into http_parer_execute().
2010-01-08 21:38:17 -08:00
Ryan Dahl
6108b765ce Bugfix: sometimes servers send \n instead of \r\n 2010-01-07 00:52:13 -08:00
Ryan Dahl
b5b116e59e Remove unused 's_headers_done' state 2010-01-06 19:01:03 -08:00
Ryan Dahl
79947a7334 Remove EOL whitespace 2010-01-06 18:54:51 -08:00
Ryan Dahl
402eda40a7 Change flag values to bit shifts 2010-01-06 18:54:39 -08:00
Ryan Dahl
0d6cebd70b wasn't correctly setting method for PROPPATCH and PROPFIND 2009-12-06 23:56:24 +01:00
Ryan Dahl
9c059ec60d Reimplement support for extension methods
This sacrifices
- a little space (10 bytes),
- a few extra calculations, and
- introduces a dependency on strncmp()
to dramatically simplify the code of parsing methods and support almost
arbitrary extension methods.

In the future I will do as NGINX does and not use strncmp but bit level
blob comparisons.
2009-12-06 23:38:27 +01:00
Ryan Dahl
12808fe1e6 accept webdav methods 2009-12-06 19:13:17 +01:00
Ryan Dahl
d53606f57e Add a macros for the usual case 2009-12-01 05:54:22 +01:00
Ryan Dahl
0cbc9101d0 Use error label, instead of returning directly 2009-11-21 22:54:31 +01:00
Ryan Dahl
51e9ff0314 Fix initialization bug.
Heap allocate parser in tests, to get errors with valgrind.
2009-11-21 21:48:56 +01:00
Ryan Dahl
873912df5e Only use s_dead in STRICT mode. 2009-11-21 17:08:40 +01:00
Ryan Dahl
a8f7a3cd78 add message_complete_on_eof test 2009-11-20 17:05:25 +01:00
Ryan Dahl
bd291ab5d8 add license file 2009-11-20 15:59:31 +01:00
Ryan Dahl
5b00b6a64f add http_should_keep_alive() 2009-11-20 15:59:31 +01:00
Ryan Dahl
5b37977e32 Don't put should_keep_alive messages in front of messages 2009-11-20 15:59:31 +01:00
Ryan Dahl
8f52d451a6 Add http version to tests 2009-11-20 15:59:31 +01:00
Ryan Dahl
717d04ce2d Optimize increasing the header_index 2009-11-20 15:59:30 +01:00
Ryan Dahl
ca1e011ab3 add response scan, fix persistent bug 2009-11-20 15:59:30 +01:00
Ryan Dahl
fb6dc67b05 strict check 2009-11-20 15:59:30 +01:00
Ryan Dahl
3ac0ebdee5 Passing tests 2009-11-20 15:59:30 +01:00
Ryan Dahl
0642366f0e change around api 2009-11-20 15:59:30 +01:00
Ryan Dahl
b283cd950f copyright header 2009-11-20 15:59:30 +01:00
Ryan Dahl
3834853a8a uri -> url 2009-11-20 15:59:30 +01:00
Ryan Dahl
d931481302 fix bug, first scan works. 2009-11-20 15:59:29 +01:00
Ryan Dahl
b71a17ec85 better output for test_scan 2009-11-20 15:59:29 +01:00
Ryan Dahl
0b8a48049c Handling chunked messages 2009-11-20 15:59:29 +01:00
Ryan Dahl
c5a92f792f Now parsing some req headers 2009-11-20 15:59:29 +01:00
Ryan Dahl
433202d825 new version
Trashing the old Ragel parser (which was based on Mongrel) because it's
proving difficult to get the control I need in end-of-message cases.
Replacing this with a hand written parser using a couple tricks borrowed
from NGINX. The new parser will be much more work to write, but should prove
faster and allow for better hacking.
2009-11-20 15:56:22 +01:00