summaryrefslogtreecommitdiff
path: root/deps/http_parser/http_parser.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-06-06 17:41:03 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-06-06 17:41:03 -0700
commit9be6c501ecf3d9432bdfca18a1b007ef4868ef5f (patch)
treeecf5f30be6766b65d1d6ff5ca60628f558b86d0b /deps/http_parser/http_parser.h
parent935f8437fd375270a0c12a106ad5b0f64da93e01 (diff)
downloadnode-new-9be6c501ecf3d9432bdfca18a1b007ef4868ef5f.tar.gz
Upgrade http-parser
Diffstat (limited to 'deps/http_parser/http_parser.h')
-rw-r--r--deps/http_parser/http_parser.h39
1 files changed, 13 insertions, 26 deletions
diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h
index 977ecdfa00..a4abf3208f 100644
--- a/deps/http_parser/http_parser.h
+++ b/deps/http_parser/http_parser.h
@@ -89,22 +89,15 @@ enum http_method
};
-enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE };
+enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
struct http_parser {
/** PRIVATE **/
- enum http_parser_type type;
- unsigned short state;
- unsigned short header_state;
- size_t index;
-
- /* 1 = Upgrade header was present and the parser has exited because of that.
- * 0 = No upgrade header present.
- * Should be checked when http_parser_execute() returns in addition to
- * error checking.
- */
- unsigned short upgrade;
+ unsigned char type;
+ unsigned char state;
+ unsigned char header_state;
+ unsigned char index;
char flags;
@@ -112,26 +105,20 @@ struct http_parser {
ssize_t body_read;
ssize_t content_length;
- const char *header_field_mark;
- size_t header_field_size;
- const char *header_value_mark;
- size_t header_value_size;
- const char *query_string_mark;
- size_t query_string_size;
- const char *path_mark;
- size_t path_size;
- const char *url_mark;
- size_t url_size;
- const char *fragment_mark;
- size_t fragment_size;
-
/** READ-ONLY **/
unsigned short status_code; /* responses only */
- enum http_method method; /* requests only */
+ unsigned short method; /* requests only */
unsigned short http_major;
unsigned short http_minor;
char buffer[HTTP_PARSER_MAX_METHOD_LEN];
+ /* 1 = Upgrade header was present and the parser has exited because of that.
+ * 0 = No upgrade header present.
+ * Should be checked when http_parser_execute() returns in addition to
+ * error checking.
+ */
+ char upgrade;
+
/** PUBLIC **/
void *data; /* A pointer to get hook to the "connection" or "socket" object */
};