HTTP/2: always handle streams in error state.

Previously, a stream could be closed by timeout if it was canceled
while its send window was exhausted.
This commit is contained in:
Valentin Bartenev 2016-07-19 20:22:44 +03:00
parent 19de85a4d7
commit da852aa468

View File

@ -1294,18 +1294,20 @@ static ngx_inline void
ngx_http_v2_handle_stream(ngx_http_v2_connection_t *h2c,
ngx_http_v2_stream_t *stream)
{
ngx_event_t *wev;
ngx_connection_t *fc;
if (stream->handled || stream->blocked || stream->exhausted) {
if (stream->handled || stream->blocked) {
return;
}
wev = stream->request->connection->write;
fc = stream->request->connection;
if (!wev->delayed) {
stream->handled = 1;
ngx_queue_insert_tail(&h2c->posted, &stream->queue);
if (!fc->error && (stream->exhausted || fc->write->delayed)) {
return;
}
stream->handled = 1;
ngx_queue_insert_tail(&h2c->posted, &stream->queue);
}