# HG changeset patch # User Valentin Bartenev # Date 1466099711 -10800 # Node ID dc5eaf998b96d6b6d724de56daaa1c32db2d3a15 # Parent d45845a6c96a056ba61f692c6a72bd372af62abb 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. 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_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 @@ } stream->rst_sent = 1; + stream->skip_data = 1; fc = stream->request->connection; fc->error = 1;