]> git.kaiwu.me - nginx.git/commitdiff
HTTP/2: prevented output of the HEADERS frame for canceled streams.
authorValentin Bartenev <vbart@nginx.com>
Tue, 19 Jul 2016 17:22:44 +0000 (20:22 +0300)
committerValentin Bartenev <vbart@nginx.com>
Tue, 19 Jul 2016 17:22:44 +0000 (20:22 +0300)
It's useless to generate HEADERS if the stream has been canceled already.

src/http/v2/ngx_http_v2_filter_module.c

index 39ff1030164b1431246e1525c3d882c876368f71..a53cae13f33bd671cf9d711b3a62118a960e9d70 100644 (file)
@@ -165,6 +165,12 @@ ngx_http_v2_header_filter(ngx_http_request_t *r)
         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_request_t *r)
         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] == '/') {