diff src/http/ngx_http_parse.c @ 8407: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 e5d4f057a6cb
children e334ca1b23ba
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -143,6 +143,7 @@ ngx_http_parse_request_line(ngx_http_req
 
         /* HTTP methods: GET, HEAD, POST */
         case sw_start:
+            r->parse_start = p;
             r->request_start = p;
             r->method_start = p;
 
@@ -883,6 +884,7 @@ ngx_http_parse_header_line(ngx_http_requ
 
         /* first char */
         case sw_start:
+            r->parse_start = p;
             r->header_name_start = p;
             r->invalid_header = 0;