[PATCH] HTTP/2: add fast-path for HTTP/2 requests without request body

Piotr Sikora piotrsikora at google.com
Sun Mar 26 08:41:23 UTC 2017


# HG changeset patch
# User Piotr Sikora <piotrsikora at google.com>
# Date 1490516712 25200
#      Sun Mar 26 01:25:12 2017 -0700
# Node ID f9fd6a8babce9f57f038d304dc1eef82284dde8b
# Parent  22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
HTTP/2: add fast-path for HTTP/2 requests without request body.

Signed-off-by: Piotr Sikora <piotrsikora at google.com>

diff -r 22be63bf21ed -r f9fd6a8babce src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -3494,7 +3494,9 @@ ngx_http_v2_read_request_body(ngx_http_r
 
     stream = r->stream;
 
-    if (stream->skip_data) {
+    if (stream->skip_data
+        || (stream->in_closed && stream->preread == NULL))
+    {
         r->request_body_no_buffering = 0;
         post_handler(r);
         return NGX_OK;


More information about the nginx-devel mailing list