# HG changeset patch # User Valentin Bartenev # Date 1461076729 -10800 # Node ID 9ac934dd5dd86b81640d6fdb4ecf5c1cf0c5ff43 # Parent 7760b54d5458afef3a1af203386290fe4ed92bd1 HTTP/2: skip data frames in case of internal errors. This prevents possible processing of such frames and triggering rb->post_handler if an error occurred during r->request_body initialization. diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -3473,6 +3473,7 @@ ngx_http_v2_read_request_body(ngx_http_r } if (rb->buf == NULL) { + stream->skip_data = 1; return NGX_HTTP_INTERNAL_SERVER_ERROR; } @@ -3494,6 +3495,7 @@ ngx_http_v2_read_request_body(ngx_http_r stream->recv_window) == NGX_ERROR) { + stream->skip_data = 1; return NGX_HTTP_INTERNAL_SERVER_ERROR; } }