]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: set r->headers_in.chunked flag after parsing headers.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 30 Jun 2020 12:32:09 +0000 (15:32 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 30 Jun 2020 12:32:09 +0000 (15:32 +0300)
Previously it was set when creating the request object.  The side-effect was
trying to discard the request body in case of header parse error.

src/http/ngx_http_request.c

index c953386d4549598f3d622d8df9669c1779c9344a..8933bb3c38f2e9612bf58ff90968669c1b3c98c9 100644 (file)
@@ -727,7 +727,6 @@ ngx_http_alloc_request(ngx_connection_t *c)
 #if (NGX_HTTP_V3)
     if (hc->quic) {
         r->http_version = NGX_HTTP_VERSION_30;
-        r->headers_in.chunked = 1;
     }
 #endif
 
@@ -2155,6 +2154,12 @@ ngx_http_process_request_header(ngx_http_request_t *r)
         }
     }
 
+#if (NGX_HTTP_V3)
+    if (r->http_version == NGX_HTTP_VERSION_30) {
+        r->headers_in.chunked = 1;
+    }
+#endif
+
     if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) {
         if (r->headers_in.keep_alive) {
             r->headers_in.keep_alive_n =