]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: drop the unwanted remainder of the request.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 25 Aug 2020 09:45:21 +0000 (12:45 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 25 Aug 2020 09:45:21 +0000 (12:45 +0300)
As per HTTP/3 draft 29, section 4.1:

   When the server does not need to receive the remainder of the request,
   it MAY abort reading the request stream, send a complete response, and
   cleanly close the sending part of the stream.

src/http/ngx_http_request.c
src/http/ngx_http_request_body.c

index 7dbbcceb217cc03e6f3394fcae48f561809bb199..e322fae4b7d29641521d22cb91824d941523c9e0 100644 (file)
@@ -2819,6 +2819,13 @@ ngx_http_finalize_connection(ngx_http_request_t *r)
     }
 #endif
 
+#if (NGX_HTTP_QUIC)
+    if (r->connection->qs) {
+        ngx_http_close_request(r, 0);
+        return;
+    }
+#endif
+
     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
     if (r->main->count != 1) {
index d0fcb00f492f4e9c09524aa5c17fef29819cc8dd..7a9bbdd5d4793c154740863f7257db7f9d86b555 100644 (file)
@@ -579,6 +579,12 @@ ngx_http_discard_request_body(ngx_http_request_t *r)
     }
 #endif
 
+#if (NGX_HTTP_QUIC)
+    if (r->connection->qs) {
+        return NGX_OK;
+    }
+#endif
+
     if (ngx_http_test_expect(r) != NGX_OK) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }