changeset 5641:0aeb6f63d242

SPDY: better detect premature closing of stream. Following a24f88eff684, now the case when the FIN flag is set in SYN_STREAM is also covered.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 07 Apr 2014 19:27:56 +0400
parents 4c6ceca4f5f7
children d2ac5cf4056d
files src/http/ngx_http_spdy.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -2962,6 +2962,16 @@ ngx_http_spdy_run_request(ngx_http_reque
         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);
 }