Welcome! Log In Create A New Profile

Advanced

[nginx] HTTP/2: return error on output on closed stream.

Maxim Dounin
July 18, 2019 11:30AM
details: https://hg.nginx.org/nginx/rev/01e26357916a
branches:
changeset: 7537:01e26357916a
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Jul 18 18:27:50 2019 +0300
description:
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:

src/http/v2/ngx_http_v2_filter_module.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diffs (16 lines):

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;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] HTTP/2: return error on output on closed stream.

Maxim Dounin 233 July 18, 2019 11:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 244
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready