diff src/http/ngx_http_request.c @ 8650:9dce2978e4fd quic

HTTP/3: eliminated r->method_start. The field was introduced to ease parsing HTTP/3 requests. The change reduces diff to the default branch.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 25 Nov 2020 17:57:43 +0000
parents 507da0d3b070
children f61d347158d0
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1162,8 +1162,12 @@ ngx_http_process_request_line(ngx_event_
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
                            "http request line: \"%V\"", &r->request_line);
 
-            r->method_name.len = r->method_end - r->method_start;
-            r->method_name.data = r->method_start;
+            r->method_name.len = r->method_end - r->request_start + 1;
+            r->method_name.data = r->request_line.data;
+
+            if (r->http_protocol.data) {
+                r->http_protocol.len = r->request_end - r->http_protocol.data;
+            }
 
             if (ngx_http_process_request_uri(r) != NGX_OK) {
                 break;