Deleted Added
1
2/*
3 * Copyright (C) NGINX, Inc.
4 * Copyright (C) Valentin V. Bartenev
5 */
6
7#ifndef _NXT_HTTP_PARSER_H_INCLUDED_
8#define _NXT_HTTP_PARSER_H_INCLUDED_

--- 76 unchanged lines hidden (view full) ---

85 uint8_t hopbyhop:1;
86 uint8_t name_length;
87 uint32_t value_length;
88 u_char *name;
89 u_char *value;
90};
91
92
93#define NXT_HTTP_FIELD_HASH_INIT 159406U
94#define nxt_http_field_hash_char(h, c) (((h) << 4) + (h) + (c))
95#define nxt_http_field_hash_end(h) (((h) >> 16) ^ (h))
96
97
98nxt_int_t nxt_http_parse_request_init(nxt_http_request_parse_t *rp,
99 nxt_mp_t *mp);
100nxt_int_t nxt_http_parse_request(nxt_http_request_parse_t *rp,
101 nxt_buf_mem_t *b);
102nxt_int_t nxt_http_parse_fields(nxt_http_request_parse_t *rp,
103 nxt_buf_mem_t *b);
104
105nxt_int_t nxt_http_fields_hash(nxt_lvlhsh_t *hash,
106 nxt_http_field_proc_t items[], nxt_uint_t count);
107nxt_uint_t nxt_http_fields_hash_collisions(nxt_lvlhsh_t *hash,
108 nxt_http_field_proc_t items[], nxt_uint_t count, nxt_bool_t level);
109nxt_int_t nxt_http_fields_process(nxt_list_t *fields, nxt_lvlhsh_t *hash,
110 void *ctx);
111
112
113extern const nxt_lvlhsh_proto_t nxt_http_fields_hash_proto;
114
115nxt_inline nxt_int_t
116nxt_http_field_process(nxt_http_field_t *field, nxt_lvlhsh_t *hash, void *ctx)
117{
118 nxt_lvlhsh_query_t lhq;
119 nxt_http_field_proc_t *proc;
120

--- 17 unchanged lines hidden ---