changeset 6637:699e409a3e0c

HTTP/2: prevented output of the HEADERS frame for canceled streams. It's useless to generate HEADERS if the stream has been canceled already.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 19 Jul 2016 20:22:44 +0300
parents ea284434db0f
children a2b310a8b2af
files src/http/v2/ngx_http_v2_filter_module.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/v2/ngx_http_v2_filter_module.c
+++ b/src/http/v2/ngx_http_v2_filter_module.c
@@ -165,6 +165,12 @@ ngx_http_v2_header_filter(ngx_http_reque
         return NGX_OK;
     }
 
+    fc = r->connection;
+
+    if (fc->error) {
+        return NGX_ERROR;
+    }
+
     if (r->method == NGX_HTTP_HEAD) {
         r->header_only = 1;
     }
@@ -255,8 +261,6 @@ ngx_http_v2_header_filter(ngx_http_reque
         len += 1 + ngx_http_v2_literal_size("Wed, 31 Dec 1986 18:00:00 GMT");
     }
 
-    fc = r->connection;
-
     if (r->headers_out.location && r->headers_out.location->value.len) {
 
         if (r->headers_out.location->value.data[0] == '/') {