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

Piotr Sikora piotrsikora at google.com
Wed Apr 5 12:32:50 UTC 2017


Hey Valentin,

> # HG changeset patch
> # User Piotr Sikora <piotrsikora at google.com>
> # Date 1490516712 25200
> #      Sun Mar 26 01:25:12 2017 -0700
> # Node ID 630a8209defe25add7094dfc7b9bc9bcabe0933d
> # 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 630a8209defe src/http/v2/ngx_http_v2.c
> --- a/src/http/v2/ngx_http_v2.c
> +++ b/src/http/v2/ngx_http_v2.c
> @@ -3520,6 +3520,12 @@ ngx_http_v2_read_request_body(ngx_http_r
>
>      r->request_body = rb;
>
> +    if (stream->in_closed && stream->preread == NULL) {
> +        r->request_body_no_buffering = 0;
> +        post_handler(r);
> +        return NGX_OK;
> +    }
> +
>      h2scf = ngx_http_get_module_srv_conf(r, ngx_http_v2_module);
>      clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
>

Any thoughts on the updated patch? Thanks!

Best regards,
Piotr Sikora


More information about the nginx-devel mailing list