summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nxt_http_parse.c17
-rw-r--r--src/nxt_http_parse.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/nxt_http_parse.c b/src/nxt_http_parse.c
index 34d88839..17bd0657 100644
--- a/src/nxt_http_parse.c
+++ b/src/nxt_http_parse.c
@@ -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)
diff --git a/src/nxt_http_parse.h b/src/nxt_http_parse.h
index da664ce9..293c4d0e 100644
--- a/src/nxt_http_parse.h
+++ b/src/nxt_http_parse.h
@@ -83,6 +83,8 @@ nxt_int_t nxt_http_parse_request_init(nxt_http_request_parse_t *rp,
nxt_mp_t *mp);
nxt_int_t 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 nxt_http_fields_hash(nxt_lvlhsh_t *hash, nxt_mp_t *mp,
nxt_http_field_proc_t items[], nxt_uint_t count);