comparison src/http/ngx_http_spdy.c @ 5520:a336cbc3dd44

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.
author Valentin Bartenev <vbart@nginx.com>
date Wed, 15 Jan 2014 17:16:38 +0400
parents 22c249dac7c1
children 03c198bb2acf
comparison
equal deleted inserted replaced
5519:22c249dac7c1 5520:a336cbc3dd44
376 if (ngx_handle_read_event(rev, 0) != NGX_OK) { 376 if (ngx_handle_read_event(rev, 0) != NGX_OK) {
377 ngx_http_spdy_finalize_connection(sc, NGX_HTTP_INTERNAL_SERVER_ERROR); 377 ngx_http_spdy_finalize_connection(sc, NGX_HTTP_INTERNAL_SERVER_ERROR);
378 return; 378 return;
379 } 379 }
380 380
381 if (sc->last_out && ngx_http_spdy_send_output_queue(sc) == NGX_ERROR) {
382 ngx_http_spdy_finalize_connection(sc, NGX_HTTP_CLIENT_CLOSED_REQUEST);
383 return;
384 }
385
381 sc->blocked = 0; 386 sc->blocked = 0;
382 387
383 if (sc->processing) { 388 if (sc->processing) {
384 if (rev->timer_set) { 389 if (rev->timer_set) {
385 ngx_del_timer(rev); 390 ngx_del_timer(rev);