]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: skip data frames in case of internal errors.
authorValentin Bartenev <vbart@nginx.com>
Tue, 19 Apr 2016 14:38:49 +0000 (17:38 +0300)
committerValentin Bartenev <vbart@nginx.com>
Tue, 19 Apr 2016 14:38:49 +0000 (17:38 +0300)
This prevents possible processing of such frames and triggering
rb->post_handler if an error occurred during r->request_body
initialization.

src/http/v2/ngx_http_v2.c

index 421cfa03a806427208a2f006d720ca7c194b31ec..dd712c121e087dc7aa9da9f1defe9201bccf89e0 100644 (file)
@@ -3473,6 +3473,7 @@ ngx_http_v2_read_request_body(ngx_http_request_t *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_request_t *r,
                                            stream->recv_window)
             == NGX_ERROR)
         {
+            stream->skip_data = 1;
             return NGX_HTTP_INTERNAL_SERVER_ERROR;
         }
     }