HTTP parser: introduced nxt_http_parse_fields().

This commit is contained in:
Valentin Bartenev
2017-12-27 15:45:23 +03:00
parent be36cf52c8
commit 45d08d5145
2 changed files with 19 additions and 0 deletions

View File

@@ -146,6 +146,23 @@ nxt_http_parse_request(nxt_http_request_parse_t *rp, nxt_buf_mem_t *b)
}
nxt_int_t
nxt_http_parse_fields(nxt_http_request_parse_t *rp, nxt_buf_mem_t *b)
{
nxt_int_t rc;
if (rp->handler == NULL) {
rp->handler = &nxt_http_parse_field_name;
}
do {
rc = rp->handler(rp, &b->pos, b->free);
} while (rc == NXT_OK);
return rc;
}
static nxt_int_t
nxt_http_parse_request_line(nxt_http_request_parse_t *rp, u_char **pos,
u_char *end)