Commit Graph

108 Commits

Author SHA1 Message Date
Marc O'Morain
11ecb42061 Docs fix
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:26:45 +01:00
Maciej Małecki
7bbb77467f doc: add very basic docs for http_parser_execute
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-24 22:19:49 +04:00
George Miroshnykov
17ed7deb7c header: typo fix in a comment
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-22 17:31:34 +04:00
Helge Heß
1317eeca43 Added support for MKCALENDAR
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-06-27 13:28:56 +04:00
Vinnie Falco
24e2d2d43f Allow HTTP_MAX_HEADER_SIZE to be defined externally 2014-03-17 14:31:29 +04:00
Fedor Indutny
56f7ad0e2e Bump version to 2.3.0 2014-03-13 13:18:11 +04:00
Fedor Indutny
cba704cb2d Bump version to 2.2.1 2014-01-29 03:17:31 +04:00
Fedor Indutny
fd609ab272 Bump version to 2.2 2013-12-20 17:32:41 +04:00
Patrik Stutz
d7b938bdca Parse and emit status message of response 2013-12-19 15:56:06 +04:00
Charlie Somerville
11419c8e41 Use unsigned int as bitfield type. 2013-11-19 12:43:27 +01:00
Ben Noordhuis
d3264312e1 Add function http_parser_version().
Fixes #115.
2013-08-21 02:48:14 +02:00
Ben Noordhuis
6df37aa52d build: set SONAME in shared object file
Fixes #151.
2013-06-13 21:38:32 +02:00
Ben Noordhuis
8081938445 Bump to version 2.1 2013-03-26 23:35:20 +01:00
Tóth Tamás
0938fe599f Add on_status_complete callback.
Add a "status complete" callback to support Simple-Response handling with HTTP
version <= 1.0.

Patch by Tóth Tamás, tests by Corey Richardson.
2012-12-17 14:56:05 +01:00
James McLaughlin
2b77aba93a Fix MSVS 2005 and 2008 missing size_t typdef.
Replace manual size_t typedef with stddef.h include

Fixes #128, #141.
2012-12-12 15:57:23 +01:00
Ben Noordhuis
245f6f0078 Remove HTTP_PARSER_DEBUG macro.
Remove the HTTP_PARSER_DEBUG macro for two reasons:

* It changes the size of struct http_parser, resulting in spurious memory
  corruption bugs if part of your application is built with HTTP_PARSER_DEBUG=1
  and other parts with HTTP_PARSER_DEBUG=0.

* It's a debugging tool for maintainers. It should never have been exposed in
  the API in the first place.
2012-11-10 23:39:34 +01:00
Peter Faiman
b4fc777dc6 fix old references to on_path 2012-10-29 20:31:29 +01:00
Ben Noordhuis
3fb4e061ec Bump to version 2.0 2012-10-10 22:38:20 +02:00
BogDan Vatra
1ca7de5258 Add "int http_body_is_final(const http_parser *parser)" method.
It's useful to check if the current chunk is the last one.
2012-09-01 03:04:48 +02:00
Ben Noordhuis
9f92347851 Make http_should_keep_alive() const correct. 2012-08-29 23:13:16 +02:00
Ben Noordhuis
2b7e87cc77 Fix bad http_should_keep_alive() comment. 2012-07-27 01:34:57 +02:00
Peter Griess
ba5acd532f Merge pull request #104 from simonz05/patch-1
Correct misspelling in http_parser.h
2012-07-24 18:06:54 -07:00
Peter Griess
fb3eeb7d05 Merge pull request #118 from bpaquet/master
#116 : refactor to allow url with basic auth a:b@toto.com
2012-07-24 18:02:19 -07:00
James McLaughlin
8ee3b0dc93 Make size_t and ssize_t Windows typedefs more appropriate 2012-07-16 01:58:31 +02:00
Bertrand Paquet
7965096276 User info implementation 2012-07-08 02:04:12 +02:00
Simon
905e959130 Correct misspelling in http_parser.h 2012-03-19 22:44:48 +01:00
Ben Noordhuis
8bec3ea459 Create method_strings array with HTTP_METHOD_MAP macro. 2012-03-12 02:18:35 +01:00
Nathan Rajlich
a3373d7627 add support for "SEARCH" request methods 2012-03-12 01:51:40 +01:00
Ben Noordhuis
36808f4fad Replace HTTP methods enum with X-macro map.
Makes it easier for integrators to generate bindings for the HTTP methods that
we support. Example:

    // stringify method names
    const char *methods[] = {
    #define XX(num, name) #name,
    HTTP_METHOD_MAP(XX)
    #undef XX
    };
2012-02-27 23:35:49 +01:00
Ben Noordhuis
efb72f175c Remove unused struct http_parser_result from header. 2012-02-26 01:29:53 +01:00
Ben Noordhuis
62110efe7a Support PURGE request method.
Fixes joyent/node#2775.
2012-02-20 16:07:00 +01:00
Randy Rizun
b215eaa749 removed obsolete CB_path, CB_query_string and CB_fragment 2012-02-15 13:34:27 +01:00
Ben Noordhuis
f668e72380 Make content_length unsigned, add overflow checks. 2012-01-27 20:49:29 +01:00
Peter Griess
d0bb867d1b Implement http_parser_pause().
Summary:
- Add http_parser_pause() API. A callback may invoke this at any time.
  This will cause http_parser_parse() to return indicating that it
  parsed less than the number of requested bytes and set an error to
  HBE_PAUSED. A paused parser with fail with HBE_PAUSED until it is
  un-paused with http_parser_pause().
- Stop using 'state', 'header_state', 'index', and 'nread' shadow
  variables and then updating their http_parser fields when we're done.
  Instead, update the live values as we go. This will make it possible
  to return from anywhere in the parser (say, due to EPAUSED) and have
  valid/expected state.
- Update state before making callbacks so that if the want to pause,
  we'll know the correct state already.
- Make sure that every callback has a state that uniquely identifies the
  next step so that we can resume in the right place if we were suppoed
  to be paused.
- Clean and re-factor up CALLBACK() macros.
- Use CALLBACK() macros for (almost) all callbacks; on_headers_complete
  is still a special case. This includes on_body which we used to invoke
  manually with a long run of bytes. We now use a 'body' mark and hit
  its callback just like every other data callback.
- Clean up (most) gotos and replace with real states.
- Add some unit tests.

Fixes #70
2012-01-08 20:43:35 -06:00
Peter Griess
d7675cd9a6 Add http_parser_parse_url().
- Add an http_parser_parse_url() method to parse a URL into its
  constituent components. This uses the same underlying parser
  as http_parser_parse() and doesn't do any data copies.
- Re-add the URL components in various test.c structures; validate
  them when parsing.
2012-01-07 16:53:11 -06:00
Ryan Dahl
3cf68f9a70 Fix compilation on MSVC 2008 which doesn't bundle stdint.h
Thanks to Steve Ridout for the patch. Fixes #69.
2011-12-13 09:37:51 -08:00
Ben Noordhuis
75dc103fd0 Single-bit bitfield 'upgrade' should be unsigned.
Fixes sparse error report: dubious one-bit signed bitfield.
2011-08-29 22:33:38 +02:00
Ryan Dahl
965f91bc76 Support MSVS 2011-08-06 02:55:51 -07:00
Fouad Mardini
2b2ba2da1a rename parser->errno to parser->http_errno; conflicts with errno.h where errno is defined as a macro 2011-07-24 18:49:54 +03:00
Peter Griess
53adfacad1 API CHANGE: Remove path, query, fragment CBs.
- Get rid of support for these callbacks in http_parser_settings.
- Retain state transitions between different URL portions in
  http_parser_execute() so that we're making the same correctness
  guarantees as before.
- These are being removed because making multiple callbacks for the same
  byte makes it more difficult to pause the parser.
2011-07-20 12:16:07 -05:00
Peter Griess
761a5eaeb1 Break out errno into its own field. 2011-07-09 11:51:13 -05:00
Peter Griess
9114e58a77 Facility to report detailed parsing errors.
- Add http_errno enum w/ values for many parsing error conditions. Stash
  this in http_parser.state if the 0x80 bit is set.
- Report line numbers on error generation if the (new) HTTP_PARSER_DEBUG
  cpp symbol is set. Increases http_parser struct size by 8 bytes in
  this case.
- Add http_errno_*() methods to help turning errno values into
  human-readable messages.
2011-06-19 13:25:03 -05:00
Ryan Dahl
eee60127c0 Support PATCH method
Requested in https://groups.google.com/forum/#!topic/nodejs-dev/iEOyiDkJRLs
2011-06-03 14:08:57 +02:00
Ryan Dahl
2839784927 HTTP_STRICT ifdefs out behavior introduced in 50b9bec
Fixes #37.
2011-05-24 09:08:06 -07:00
Peter Griess
b1c2cf83fd Expose F_* flags as public API.
Fixes #42.
2011-05-24 08:57:13 -07:00
Ryan Dahl
32c0e11583 bump to v1.0 2011-05-11 20:57:36 -07:00
Ryan Dahl
63daf22f2c Update copyright headers 2011-03-22 13:30:24 -07:00
Nathan Rajlich
f825b52b7f Added support for "SUBSCRIBE" and "UNSUBSCRIBE" request methods. 2010-11-21 21:37:57 -08:00
Nathan Rajlich
d56a0700d0 Add support for "M-SEARCH" and "NOTIFY" request methods.
Allow a request path of "*" (for SSDP requests).
2010-11-21 21:37:57 -08:00
Aman Gupta
cae8a96c16 Fix build issues using mingw32 on windows 2010-11-10 21:58:55 -08:00