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.
This commit is contained in:
Valentin Bartenev 2014-01-15 17:16:38 +04:00
parent 82a1ff31f9
commit 1ef5553644

View File

@ -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) {