144 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
88d11b394d Support Upgrade header 2010-04-14 03:17:11 -07:00
Ryan Dahl
6f72c780f0 Remove stddef include, it's included in http_parser.c 2010-03-13 20:55:55 -08:00
Ryan Dahl
e07e0b952e Tasteful vertical whitespace. 2010-02-27 21:24:09 -08:00
Ryan Dahl
dbd2dad461 Introduce http_parser_settings 2010-02-27 20:31:05 -08:00
Ryan Dahl
d37a9c5b9b fix typos 2010-02-22 08:11:01 -08:00
Ryan Dahl
1b30bf4ba5 Only allow 80kb of header bytes 2010-02-02 16:41:45 -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
1d9ebac036 Revert "Add method -> string lookup"
This reverts commit b795f94686.

(I don't like this feature, and I'm not using it.)
2010-01-06 19:03:32 -08:00
Ryan Dahl
79947a7334 Remove EOL whitespace 2010-01-06 18:54:51 -08:00
Ryan Dahl
b795f94686 Add method -> string lookup 2009-12-07 15:17:49 +01:00
Ryan Dahl
4aebd8bbb9 reorder methods 2009-12-07 00:15:22 +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
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
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
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
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
Ryan Dahl
2769741ba5 Fix LICENSE 2009-11-14 14:46:10 +01:00
Ryan Dahl
ce381895aa Use enums instead of defines (for better debugging symbols) 2009-10-27 13:50:54 +01:00
Ryan
dbbc73c16f API Change: Return void from http_parser_execute(). 2009-08-22 14:30:30 +02:00
Ryan
efd801f410 Bug Fix: Connection:close with missing Content-Length.
The test and bug report are from tomika.
2009-08-22 14:27:58 +02:00
Ryan
f3214f9764 Move transfer encoding into flags bitfield. 2009-08-21 01:49:57 +02:00
Ryan
e65dcfbcf2 Use bit flags 2009-08-20 23:16:18 +02:00
Ryan
a7b96d81f1 API Change: parser->version_major/minor replaced with parser->version.
Allows for simpler processing.
2009-08-20 13:57:36 +02:00
Ryan
59a37f6600 Inline http_parser_should_keep_alive(). 2009-08-20 13:32:31 +02:00
Ryan
e244dbf797 Fix whitespace, clean up some macros. 2009-08-20 13:26:08 +02:00
tomika
152cce76df Include added for MSC compatibilty 2009-08-19 12:43:55 +02:00
Joe Damato
431707b5b1 fixing bitfield misuse 2009-08-07 13:32:11 +02:00
Ryan
cc5c9b037c Correctly error out on non-zero return values. 2009-06-12 17:26:21 +02:00
Ryan
9f59cd926f Check for buffer overflow attacks. 2009-06-09 15:16:36 +02:00
Ryan
961d455618 Add license file with Mongrel's license. 2009-06-09 14:18:25 +02:00
Ryan
8cae1feeb4 random clean ups 2009-04-27 17:07:07 +02:00
Ryan
7898f1a97a add http_parser_should_keep_alive() 2009-04-27 16:54:09 +02:00
Ryan
c288a966fe lint 2009-04-26 20:52:53 +02:00
Ryan
5214fb2524 for clarity, replace is_request_stream with enum http_parser_type 2009-04-26 20:44:28 +02:00
Ryan
97d4572c68 Remove "ebb_message" object from libebb's parser.
And much more:
 * Begin the framework for parsing HTTP responses
 * Modify the test code with the new layout
 * Remove EBB_ prefix and use just HTTP_
 * Start simple new Makefile

Currently the test passes but it is only checking HTTP requests. I get the
feeling that it is much slower than before, although I have no solid
evidence for this.
2009-04-25 13:33:16 +02:00