From 1ef5553644e9becd61ac7a6e5d3a673374b947a5 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 15 Jan 2014 17:16:38 +0400 Subject: 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. --- src/http/ngx_http_spdy.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/http') 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) { -- cgit