comparison src/http/v3/ngx_http_v3_request.c @ 7884:d6feece1288a quic

Fixed $request_length for HTTP/3. New field r->parse_start is introduced to substitute r->request_start and r->header_name_start for request length accounting. These fields only work for this purpose in HTTP/1 because HTTP/1 request line and header line start with these values. Also, error logging is now fixed to output the right part of the request.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 19 May 2020 15:47:37 +0300
parents 66feab03d9b7
children 5b367070cc9c
comparison
equal deleted inserted replaced
7883:66feab03d9b7 7884:d6feece1288a
57 if (st == NULL) { 57 if (st == NULL) {
58 goto failed; 58 goto failed;
59 } 59 }
60 60
61 r->h3_parse = st; 61 r->h3_parse = st;
62 r->parse_start = b->pos;
62 } 63 }
63 64
64 while (b->pos < b->last) { 65 while (b->pos < b->last) {
65 rc = ngx_http_v3_parse_headers(c, st, *b->pos++); 66 rc = ngx_http_v3_parse_headers(c, st, *b->pos++);
66 67
128 129
129 c = r->connection; 130 c = r->connection;
130 st = r->h3_parse; 131 st = r->h3_parse;
131 132
132 if (st->header_rep.state == 0) { 133 if (st->header_rep.state == 0) {
134 r->parse_start = b->pos;
133 r->invalid_header = 0; 135 r->invalid_header = 0;
134 } 136 }
135 137
136 if (st->state == 0) { 138 if (st->state == 0) {
137 if (r->header_name_start == NULL) { 139 if (r->header_name_start == NULL) {