@ -94,17 +94,10 @@ enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
struct http_parser {
struct http_parser {
/** PRIVATE **/
/** PRIVATE **/
enum http_parser_type type ;
unsigned char type ;
unsigned short state ;
unsigned char state ;
unsigned short header_state ;
unsigned char header_state ;
size_t index ;
unsigned char 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 ;
char flags ;
char flags ;
@ -122,11 +115,18 @@ struct http_parser {
/** READ-ONLY **/
/** READ-ONLY **/
unsigned short status_code ; /* responses 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_major ;
unsigned short http_minor ;
unsigned short http_minor ;
char buffer [ HTTP_PARSER_MAX_METHOD_LEN ] ;
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 **/
/** PUBLIC **/
void * data ; /* A pointer to get hook to the "connection" or "socket" object */
void * data ; /* A pointer to get hook to the "connection" or "socket" object */
} ;
} ;