comparison src/http/v2/ngx_http_v2.c @ 6753:20485a482bc0 stable-1.10

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.
author Valentin Bartenev <vbart@nginx.com>
date Thu, 16 Jun 2016 20:55:11 +0300
parents 0708285115fa
children 78533a74af11
comparison
equal deleted inserted replaced
6752:0708285115fa 6753:20485a482bc0
3888 ngx_http_v2_stream_t *stream, ngx_uint_t status) 3888 ngx_http_v2_stream_t *stream, ngx_uint_t status)
3889 { 3889 {
3890 ngx_event_t *rev; 3890 ngx_event_t *rev;
3891 ngx_connection_t *fc; 3891 ngx_connection_t *fc;
3892 3892
3893 if (stream->rst_sent) {
3894 return NGX_OK;
3895 }
3896
3893 if (ngx_http_v2_send_rst_stream(h2c, stream->node->id, status) 3897 if (ngx_http_v2_send_rst_stream(h2c, stream->node->id, status)
3894 == NGX_ERROR) 3898 == NGX_ERROR)
3895 { 3899 {
3896 return NGX_ERROR; 3900 return NGX_ERROR;
3897 } 3901 }
3898 3902
3899 stream->rst_sent = 1; 3903 stream->rst_sent = 1;
3904 stream->skip_data = 1;
3900 3905
3901 fc = stream->request->connection; 3906 fc = stream->request->connection;
3902 fc->error = 1; 3907 fc->error = 1;
3903 3908
3904 rev = fc->read; 3909 rev = fc->read;