|
|
@ -193,11 +193,11 @@ enum http_errno {
|
|
|
|
|
|
|
|
|
|
|
|
struct http_parser {
|
|
|
|
struct http_parser {
|
|
|
|
/** PRIVATE **/
|
|
|
|
/** PRIVATE **/
|
|
|
|
unsigned char type : 2; /* enum http_parser_type */
|
|
|
|
unsigned int type : 2; /* enum http_parser_type */
|
|
|
|
unsigned char flags : 6; /* F_* values from 'flags' enum; semi-public */
|
|
|
|
unsigned int flags : 6; /* F_* values from 'flags' enum; semi-public */
|
|
|
|
unsigned char state; /* enum state from http_parser.c */
|
|
|
|
unsigned int state : 8; /* enum state from http_parser.c */
|
|
|
|
unsigned char header_state; /* enum header_state from http_parser.c */
|
|
|
|
unsigned int header_state : 8; /* enum header_state from http_parser.c */
|
|
|
|
unsigned char index; /* index into current matcher */
|
|
|
|
unsigned int index : 8; /* index into current matcher */
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t nread; /* # bytes read in various scenarios */
|
|
|
|
uint32_t nread; /* # bytes read in various scenarios */
|
|
|
|
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
|
|
|
|
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
|
|
|
@ -205,16 +205,16 @@ struct http_parser {
|
|
|
|
/** READ-ONLY **/
|
|
|
|
/** READ-ONLY **/
|
|
|
|
unsigned short http_major;
|
|
|
|
unsigned short http_major;
|
|
|
|
unsigned short http_minor;
|
|
|
|
unsigned short http_minor;
|
|
|
|
unsigned short status_code; /* responses only */
|
|
|
|
unsigned int status_code : 16; /* responses only */
|
|
|
|
unsigned char method; /* requests only */
|
|
|
|
unsigned int method : 8; /* requests only */
|
|
|
|
unsigned char http_errno : 7;
|
|
|
|
unsigned int http_errno : 7;
|
|
|
|
|
|
|
|
|
|
|
|
/* 1 = Upgrade header was present and the parser has exited because of that.
|
|
|
|
/* 1 = Upgrade header was present and the parser has exited because of that.
|
|
|
|
* 0 = No upgrade header present.
|
|
|
|
* 0 = No upgrade header present.
|
|
|
|
* Should be checked when http_parser_execute() returns in addition to
|
|
|
|
* Should be checked when http_parser_execute() returns in addition to
|
|
|
|
* error checking.
|
|
|
|
* error checking.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
unsigned char upgrade : 1;
|
|
|
|
unsigned int upgrade : 1;
|
|
|
|
|
|
|
|
|
|
|
|
/** 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 */
|
|
|
|