# HG changeset patch # User Maxim Dounin # Date 1563463670 -10800 # Node ID 01e26357916a2293f27653db8a887892475d3acf # Parent c3f60d618c1738620ae82d75f132b18b7f63bd97 HTTP/2: return error on output on closed stream. Without this, an (incorrect) output on a closed stream could result in a socket leak. diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c --- a/src/http/v2/ngx_http_v2_filter_module.c +++ b/src/http/v2/ngx_http_v2_filter_module.c @@ -1444,6 +1444,12 @@ ngx_http_v2_send_chain(ngx_connection_t if (in == NULL || stream->out_closed) { + if (size) { + ngx_log_error(NGX_LOG_ERR, fc->log, 0, + "output on closed stream"); + return NGX_CHAIN_ERROR; + } + if (stream->queued) { fc->write->active = 1; fc->write->ready = 0;