* which marks the end of the line (LF or CRLF).
*/
struct http_msg {
- int msg_state; /* where we are in the current message parsing */
+ unsigned int msg_state; /* where we are in the current message parsing */
char *sol; /* start of line, also start of message when fully parsed */
char *eol; /* end of line */
- int som; /* Start Of Message, relative to buffer */
- int col, sov; /* current header: colon, start of value */
- int eoh; /* End Of Headers, relative to buffer */
+ unsigned int som; /* Start Of Message, relative to buffer */
+ unsigned int col, sov; /* current header: colon, start of value */
+ unsigned int eoh; /* End Of Headers, relative to buffer */
char **cap; /* array of captured headers (may be NULL) */
union { /* useful start line pointers, relative to buffer */
struct {
* within its state machine and use the same macros, hence the need for same
* labels and variable names. Note that msg->sol is left unchanged.
*/
-const char *http_parse_stsline(struct http_msg *msg, const char *msg_buf, int state,
- const char *ptr, const char *end,
- char **ret_ptr, int *ret_state)
+const char *http_parse_stsline(struct http_msg *msg, const char *msg_buf,
+ unsigned int state, const char *ptr, const char *end,
+ char **ret_ptr, unsigned int *ret_state)
{
__label__
http_msg_rpver,
* within its state machine and use the same macros, hence the need for same
* labels and variable names. Note that msg->sol is left unchanged.
*/
-const char *http_parse_reqline(struct http_msg *msg, const char *msg_buf, int state,
- const char *ptr, const char *end,
- char **ret_ptr, int *ret_state)
+const char *http_parse_reqline(struct http_msg *msg, const char *msg_buf,
+ unsigned int state, const char *ptr, const char *end,
+ char **ret_ptr, unsigned int *ret_state)
{
__label__
http_msg_rqmeth,
http_msg_ood, /* out of data */
http_msg_invalid;
- int state; /* updated only when leaving the FSM */
+ unsigned int state; /* updated only when leaving the FSM */
register char *ptr, *end; /* request pointers, to avoid dereferences */
state = msg->msg_state;