diff options
author | Igor Sysoev <igor@sysoev.ru> | 2020-06-23 14:16:45 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2020-06-23 14:16:45 +0300 |
commit | 65799c7252e56d287d967bf3f036a10d5764f82c (patch) | |
tree | 70488dd10766b07784732fab1074dde526732fae /src/nxt_http_parse.h | |
parent | f671d1bc54d6db164cf4b03a9ef0e1ddcdd39c72 (diff) | |
download | unit-65799c7252e56d287d967bf3f036a10d5764f82c.tar.gz unit-65799c7252e56d287d967bf3f036a10d5764f82c.tar.bz2 |
Upstream chunked transfer encoding support.
Diffstat (limited to 'src/nxt_http_parse.h')
-rw-r--r-- | src/nxt_http_parse.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nxt_http_parse.h b/src/nxt_http_parse.h index 0f888949..cbfc8433 100644 --- a/src/nxt_http_parse.h +++ b/src/nxt_http_parse.h @@ -90,6 +90,19 @@ struct nxt_http_field_s { }; +typedef struct { + u_char *pos; + nxt_mp_t *mem_pool; + + uint64_t chunk_size; + + uint8_t state; + uint8_t last; /* 1 bit */ + uint8_t chunk_error; /* 1 bit */ + uint8_t error; /* 1 bit */ +} nxt_http_chunk_parse_t; + + #define NXT_HTTP_FIELD_HASH_INIT 159406U #define nxt_http_field_hash_char(h, c) (((h) << 4) + (h) + (c)) #define nxt_http_field_hash_end(h) (((h) >> 16) ^ (h)) @@ -109,6 +122,9 @@ nxt_uint_t nxt_http_fields_hash_collisions(nxt_lvlhsh_t *hash, nxt_int_t nxt_http_fields_process(nxt_list_t *fields, nxt_lvlhsh_t *hash, void *ctx); +nxt_buf_t *nxt_http_chunk_parse(nxt_task_t *task, nxt_http_chunk_parse_t *hcp, + nxt_buf_t *in); + extern const nxt_lvlhsh_proto_t nxt_http_fields_hash_proto; |