comparison src/http/v2/ngx_http_v2.c @ 6520:9070ba416284

HTTP/2: send the output queue after emitting WINDOW_UPDATE. The WINDOW_UPDATE frame could be left in the output queue for an indefinite period of time resulting in the request timeout. This might happen if reading of the body was triggered by an event unrelated to client connection, e.g. by the limit_req timer.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 19 Apr 2016 17:38:49 +0300
parents 9ac934dd5dd8
children ce94f07d5082
comparison
equal deleted inserted replaced
6519:9ac934dd5dd8 6520:9070ba416284
3412 { 3412 {
3413 off_t len; 3413 off_t len;
3414 ngx_http_v2_stream_t *stream; 3414 ngx_http_v2_stream_t *stream;
3415 ngx_http_request_body_t *rb; 3415 ngx_http_request_body_t *rb;
3416 ngx_http_core_loc_conf_t *clcf; 3416 ngx_http_core_loc_conf_t *clcf;
3417 ngx_http_v2_connection_t *h2c;
3417 3418
3418 stream = r->stream; 3419 stream = r->stream;
3419 3420
3420 if (stream->skip_data) { 3421 if (stream->skip_data) {
3421 r->request_body_no_buffering = 0; 3422 r->request_body_no_buffering = 0;
3495 stream->recv_window) 3496 stream->recv_window)
3496 == NGX_ERROR) 3497 == NGX_ERROR)
3497 { 3498 {
3498 stream->skip_data = 1; 3499 stream->skip_data = 1;
3499 return NGX_HTTP_INTERNAL_SERVER_ERROR; 3500 return NGX_HTTP_INTERNAL_SERVER_ERROR;
3501 }
3502
3503 h2c = stream->connection;
3504
3505 if (!h2c->blocked) {
3506 if (ngx_http_v2_send_output_queue(h2c) == NGX_ERROR) {
3507 stream->skip_data = 1;
3508 return NGX_HTTP_INTERNAL_SERVER_ERROR;
3509 }
3500 } 3510 }
3501 } 3511 }
3502 3512
3503 ngx_add_timer(r->connection->read, clcf->client_body_timeout); 3513 ngx_add_timer(r->connection->read, clcf->client_body_timeout);
3504 3514