Welcome! Log In Create A New Profile

Advanced

[nginx] HTTP/2: prevented double termination of a stream.

Valentin Bartenev
June 16, 2016 01:58PM
details: http://hg.nginx.org/nginx/rev/dc5eaf998b96
branches:
changeset: 6588:dc5eaf998b96
user: Valentin Bartenev <vbart@nginx.com>
date: Thu Jun 16 20:55:11 2016 +0300
description:
HTTP/2: prevented double termination of a stream.

According to RFC 7540, an endpoint should not send more than one RST_STREAM
frame for any stream.

Also, now all the data frames will be skipped while termination.

diffstat:

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

diffs (22 lines):

diff -r d45845a6c96a -r dc5eaf998b96 src/http/v2/ngx_http_v2.c
--- a/src/http/v2/ngx_http_v2.c Thu Jun 16 20:55:11 2016 +0300
+++ b/src/http/v2/ngx_http_v2.c Thu Jun 16 20:55:11 2016 +0300
@@ -3890,6 +3890,10 @@ ngx_http_v2_terminate_stream(ngx_http_v2
ngx_event_t *rev;
ngx_connection_t *fc;

+ if (stream->rst_sent) {
+ return NGX_OK;
+ }
+
if (ngx_http_v2_send_rst_stream(h2c, stream->node->id, status)
== NGX_ERROR)
{
@@ -3897,6 +3901,7 @@ ngx_http_v2_terminate_stream(ngx_http_v2
}

stream->rst_sent = 1;
+ stream->skip_data = 1;

fc = stream->request->connection;
fc->error = 1;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] HTTP/2: prevented double termination of a stream.

Valentin Bartenev 317 June 16, 2016 01:58PM



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

Online Users

Guests: 132
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