diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-06-23 21:10:13 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-06-23 21:10:13 -0700 |
commit | 8825c74e7aea20f24bc2f6c165cb3ce3d5011b77 (patch) | |
tree | b6495d0474f3a4638c4b4415241f0da226ac4d98 /deps/http_parser/http_parser.h | |
parent | 2c0d91be6c8972f325b64a15c798f45e68bf183a (diff) | |
download | node-new-8825c74e7aea20f24bc2f6c165cb3ce3d5011b77.tar.gz |
Upgrade http-parser
Diffstat (limited to 'deps/http_parser/http_parser.h')
-rw-r--r-- | deps/http_parser/http_parser.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h index a4abf3208f..1895d7979e 100644 --- a/deps/http_parser/http_parser.h +++ b/deps/http_parser/http_parser.h @@ -63,29 +63,30 @@ typedef int (*http_data_cb) (http_parser*, const char *at, size_t length); typedef int (*http_cb) (http_parser*); -/* Should be at least one longer than the longest request method */ -#define HTTP_PARSER_MAX_METHOD_LEN 10 - - /* Request Methods */ enum http_method - { HTTP_DELETE = 0x0001 - , HTTP_GET = 0x0002 - , HTTP_HEAD = 0x0004 - , HTTP_POST = 0x0008 - , HTTP_PUT = 0x0010 + { HTTP_DELETE = 0 + , HTTP_GET + , HTTP_HEAD + , HTTP_POST + , HTTP_PUT /* pathological */ - , HTTP_CONNECT = 0x0020 - , HTTP_OPTIONS = 0x0040 - , HTTP_TRACE = 0x0080 + , HTTP_CONNECT + , HTTP_OPTIONS + , HTTP_TRACE /* webdav */ - , HTTP_COPY = 0x0100 - , HTTP_LOCK = 0x0200 - , HTTP_MKCOL = 0x0400 - , HTTP_MOVE = 0x0800 - , HTTP_PROPFIND = 0x1000 - , HTTP_PROPPATCH = 0x2000 - , HTTP_UNLOCK = 0x4000 + , HTTP_COPY + , HTTP_LOCK + , HTTP_MKCOL + , HTTP_MOVE + , HTTP_PROPFIND + , HTTP_PROPPATCH + , HTTP_UNLOCK + /* subversion */ + , HTTP_REPORT + , HTTP_MKACTIVITY + , HTTP_CHECKOUT + , HTTP_MERGE }; @@ -102,15 +103,13 @@ struct http_parser { char flags; size_t nread; - ssize_t body_read; ssize_t content_length; /** READ-ONLY **/ - unsigned short status_code; /* responses only */ - unsigned short method; /* requests only */ unsigned short http_major; unsigned short http_minor; - char buffer[HTTP_PARSER_MAX_METHOD_LEN]; + unsigned short status_code; /* responses only */ + unsigned char method; /* requests only */ /* 1 = Upgrade header was present and the parser has exited because of that. * 0 = No upgrade header present. @@ -155,6 +154,8 @@ size_t http_parser_execute(http_parser *parser, */ int http_should_keep_alive(http_parser *parser); +/* Returns a string version of the HTTP method. */ +const char *http_method_str(enum http_method); #ifdef __cplusplus } |