]> git.kaiwu.me - nginx.git/commitdiff
SPDY: better detect premature closing of stream.
authorValentin Bartenev <vbart@nginx.com>
Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)
committerValentin Bartenev <vbart@nginx.com>
Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)
Following a24f88eff684, now the case when the FIN flag is set in SYN_STREAM
is also covered.

src/http/ngx_http_spdy.c

index 92f2a00c62cf0e1d236a9702efbfd5fcdfb108e9..d821475d2bcdb57a2fc2b2882336ceaa7a20c635 100644 (file)
@@ -2962,6 +2962,16 @@ ngx_http_spdy_run_request(ngx_http_request_t *r)
         return;
     }
 
+    if (r->headers_in.content_length_n > 0 && r->spdy_stream->in_closed) {
+        ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
+                      "client prematurely closed stream");
+
+        r->spdy_stream->skip_data = NGX_SPDY_DATA_ERROR;
+
+        ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
+        return;
+    }
+
     ngx_http_process_request(r);
 }