aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-01-15 17:16:38 +0400
committerValentin Bartenev <vbart@nginx.com>2014-01-15 17:16:38 +0400
commit1ef5553644e9becd61ac7a6e5d3a673374b947a5 (patch)
treee82844a9c00df55c082d9b1a8282de5e99adbed6
parent82a1ff31f9ff38ef2fabdff7857fe0fc974e8a8b (diff)
downloadnginx-1ef5553644e9becd61ac7a6e5d3a673374b947a5.tar.gz
nginx-1ef5553644e9becd61ac7a6e5d3a673374b947a5.zip
SPDY: send output queue after processing of read event.
During the processing of input some control frames can be added to the queue. And if there were no writing streams at the moment, these control frames might be left unsent for a long time (or even forever). This long delay is especially critical for PING replies since a client can consider connection as broken and then resend exactly the same request over a new connection, which is not safe in case of non-idempotent HTTP methods.
-rw-r--r--src/http/ngx_http_spdy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
index 46467ac4d..a01e0b100 100644
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -378,6 +378,11 @@ ngx_http_spdy_read_handler(ngx_event_t *rev)
return;
}
+ if (sc->last_out && ngx_http_spdy_send_output_queue(sc) == NGX_ERROR) {
+ ngx_http_spdy_finalize_connection(sc, NGX_HTTP_CLIENT_CLOSED_REQUEST);
+ return;
+ }
+
sc->blocked = 0;
if (sc->processing) {