mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 14:56:15 +08:00
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.
This commit is contained in:
parent
24d9b98900
commit
cd2085be0c
@ -3890,6 +3890,10 @@ ngx_http_v2_terminate_stream(ngx_http_v2_connection_t *h2c,
|
|||||||
ngx_event_t *rev;
|
ngx_event_t *rev;
|
||||||
ngx_connection_t *fc;
|
ngx_connection_t *fc;
|
||||||
|
|
||||||
|
if (stream->rst_sent) {
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if (ngx_http_v2_send_rst_stream(h2c, stream->node->id, status)
|
if (ngx_http_v2_send_rst_stream(h2c, stream->node->id, status)
|
||||||
== NGX_ERROR)
|
== NGX_ERROR)
|
||||||
{
|
{
|
||||||
@ -3897,6 +3901,7 @@ ngx_http_v2_terminate_stream(ngx_http_v2_connection_t *h2c,
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream->rst_sent = 1;
|
stream->rst_sent = 1;
|
||||||
|
stream->skip_data = 1;
|
||||||
|
|
||||||
fc = stream->request->connection;
|
fc = stream->request->connection;
|
||||||
fc->error = 1;
|
fc->error = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user