diff --git a/http_parser.h b/http_parser.h index de6d66d..1ca3d7a 100644 --- a/http_parser.h +++ b/http_parser.h @@ -94,17 +94,10 @@ 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; @@ -122,11 +115,18 @@ struct http_parser { /** 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 */ };