Expose F_* flags as public API.

Fixes #42.
v0.6
Peter Griess 14 years ago committed by Ryan Dahl
parent 8dabce6ec7
commit b1c2cf83fd

@ -314,16 +314,6 @@ enum header_states
}; };
enum flags
{ F_CHUNKED = 1 << 0
, F_CONNECTION_KEEP_ALIVE = 1 << 1
, F_CONNECTION_CLOSE = 1 << 2
, F_TRAILING = 1 << 3
, F_UPGRADE = 1 << 4
, F_SKIPBODY = 1 << 5
};
#define CR '\r' #define CR '\r'
#define LF '\n' #define LF '\n'
#define LOWER(c) (unsigned char)(c | 0x20) #define LOWER(c) (unsigned char)(c | 0x20)

@ -114,10 +114,21 @@ enum http_method
enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH }; enum http_parser_type { HTTP_REQUEST, HTTP_RESPONSE, HTTP_BOTH };
/* Flag values for http_parser.flags field */
enum flags
{ F_CHUNKED = 1 << 0
, F_CONNECTION_KEEP_ALIVE = 1 << 1
, F_CONNECTION_CLOSE = 1 << 2
, F_TRAILING = 1 << 3
, F_UPGRADE = 1 << 4
, F_SKIPBODY = 1 << 5
};
struct http_parser { struct http_parser {
/** PRIVATE **/ /** PRIVATE **/
unsigned char type : 2; unsigned char type : 2;
unsigned char flags : 6; unsigned char flags : 6; /* F_* values from 'flags' enum; semi-public */
unsigned char state; unsigned char state;
unsigned char header_state; unsigned char header_state;
unsigned char index; unsigned char index;

Loading…
Cancel
Save