[PATCH] HTTP/2: emit PROTOCOL_ERROR on padding errors

Valentin V. Bartenev vbart at nginx.com
Mon Mar 27 19:17:44 UTC 2017


On Sunday 26 March 2017 01:41:13 Piotr Sikora via nginx-devel wrote:
> # HG changeset patch
> # User Piotr Sikora <piotrsikora at google.com>
> # Date 1490516705 25200
> #      Sun Mar 26 01:25:05 2017 -0700
> # Node ID 8d3fb456411018e286345ba92a855ca42ca8af2f
> # Parent  22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
> HTTP/2: emit PROTOCOL_ERROR on padding errors.
> 
> Signed-off-by: Piotr Sikora <piotrsikora at google.com>
> 
> diff -r 22be63bf21ed -r 8d3fb4564110 src/http/v2/ngx_http_v2.c
> --- a/src/http/v2/ngx_http_v2.c
> +++ b/src/http/v2/ngx_http_v2.c
> @@ -810,7 +810,8 @@ ngx_http_v2_state_data(ngx_http_v2_conne
>                            "with incorrect length: %uz, padding: %uz",
>                            h2c->state.length, h2c->state.padding);
>  
> -            return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
> +            return ngx_http_v2_connection_error(h2c,
> +                                                NGX_HTTP_V2_PROTOCOL_ERROR);
>          }
>  
>          h2c->state.length -= h2c->state.padding;
> @@ -1053,7 +1054,8 @@ ngx_http_v2_state_headers(ngx_http_v2_co
>                            "with incorrect length: %uz, padding: %uz",
>                            h2c->state.length, h2c->state.padding);
>  
> -            return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
> +            return ngx_http_v2_connection_error(h2c,
> +                                                NGX_HTTP_V2_PROTOCOL_ERROR);
>          }
>  
>          h2c->state.length -= h2c->state.padding;
> 

Looks good.

  wbr, Valentin V. Bartenev



More information about the nginx-devel mailing list