# HG changeset patch # User Valentin Bartenev # Date 1396884476 -14400 # Node ID 0aeb6f63d242f953ff8e8231d0bdd4a296cef08b # Parent 4c6ceca4f5f71d6bcbceb0744ed82cdd8ce5906e SPDY: better detect premature closing of stream. Following a24f88eff684, now the case when the FIN flag is set in SYN_STREAM is also covered. diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c --- 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); }