diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-01-09 01:52:49 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-01-09 01:52:49 -0800 |
commit | c9e21435c02d07c052d02b1b1a55732fdbc880e2 (patch) | |
tree | 6c1218ed86d90b961b9089a34e5c4cd2310e76d5 /deps/http_parser/http_parser.h | |
parent | b3349eb33abb65969dbb3b96bb797413c594652a (diff) | |
download | node-new-c9e21435c02d07c052d02b1b1a55732fdbc880e2.tar.gz |
Upgrade http-parser
Diffstat (limited to 'deps/http_parser/http_parser.h')
-rw-r--r-- | deps/http_parser/http_parser.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h index 5855e89405..a1439ea364 100644 --- a/deps/http_parser/http_parser.h +++ b/deps/http_parser/http_parser.h @@ -1,4 +1,4 @@ -/* Copyright 2009 Ryan Dahl <ry@tinyclouds.org> +/* Copyright 2009,2010 Ryan Dahl <ry@tinyclouds.org> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -74,8 +74,11 @@ enum http_method , HTTP_UNLOCK = 0x4000 }; +enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE }; + struct http_parser { /** PRIVATE **/ + enum http_parser_type type; unsigned short state; unsigned short header_state; size_t index; @@ -125,9 +128,8 @@ struct http_parser { http_cb on_message_complete; }; -void http_parser_init(http_parser *parser); -size_t http_parse_requests(http_parser *parser, const char *data, size_t len); -size_t http_parse_responses(http_parser *parser, const char *data, size_t len); +void http_parser_init(http_parser *parser, enum http_parser_type type); +size_t http_parser_execute(http_parser *parser, const char *data, size_t len); /* Call this in the on_headers_complete or on_message_complete callback to * determine if this will be the last message on the connection. * If you are the server, respond with the "Connection: close" header |