aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2016-06-16 20:55:11 +0300
committerValentin Bartenev <vbart@nginx.com>2016-06-16 20:55:11 +0300
commitcd2085be0c497153f9311f0a1986c6be6a18cff4 (patch)
tree874a6e4658367f8931ce2583be177c5fedfc52e5 /src
parent24d9b98900a5318778dcab3f765e85a8bed5d136 (diff)
downloadnginx-cd2085be0c497153f9311f0a1986c6be6a18cff4.tar.gz
nginx-cd2085be0c497153f9311f0a1986c6be6a18cff4.zip
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 (limited to 'src')
-rw-r--r--src/http/v2/ngx_http_v2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
index 94f57a717..99cb3fc70 100644
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -3890,6 +3890,10 @@ ngx_http_v2_terminate_stream(ngx_http_v2_connection_t *h2c,
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_connection_t *h2c,
}
stream->rst_sent = 1;
+ stream->skip_data = 1;
fc = stream->request->connection;
fc->error = 1;