aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2019-07-18 18:27:50 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2019-07-18 18:27:50 +0300
commit36dfa020f256dfc5beed3366be099d99543ad5b2 (patch)
tree58c0b729b8539447e5c3b890fd15f2a6a02bec96 /src
parent551640703a502a252b24c84d1b9e6541ee88de34 (diff)
downloadnginx-36dfa020f256dfc5beed3366be099d99543ad5b2.tar.gz
nginx-36dfa020f256dfc5beed3366be099d99543ad5b2.zip
HTTP/2: return error on output on closed stream.
Without this, an (incorrect) output on a closed stream could result in a socket leak.
Diffstat (limited to 'src')
-rw-r--r--src/http/v2/ngx_http_v2_filter_module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c
index 853faefd3..81e6c513a 100644
--- 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 *fc, ngx_chain_t *in, off_t limit)
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;