Klaus Demo nginx / 536b551
HTTP/2: refuse streams with data until SETTINGS is acknowledged. A client is allowed to send requests before receiving and acknowledging the SETTINGS frame. Such a client having a wrong idea about the stream's could send the request body that nginx isn't ready to process. The previous behavior was to send RST_STREAM with FLOW_CONTROL_ERROR in such case, but it didn't allow retrying requests that have been rejected. Valentin Bartenev 4 years ago
2 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
10571057 goto rst_stream;
10581058 }
10591059
1060 if (!h2c->settings_ack && !(h2c->state.flags & NGX_HTTP_V2_END_STREAM_FLAG))
1061 {
1062 status = NGX_HTTP_V2_REFUSED_STREAM;
1063 goto rst_stream;
1064 }
1065
10601066 node = ngx_http_v2_get_node_by_id(h2c, h2c->state.sid, 1);
10611067
10621068 if (node == NULL) {
18771883 return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_SIZE_ERROR);
18781884 }
18791885
1880 /* TODO settings acknowledged */
1886 h2c->settings_ack = 1;
18811887
18821888 return ngx_http_v2_state_complete(h2c, pos, end);
18831889 }
140140 ngx_uint_t last_sid;
141141
142142 unsigned closed_nodes:8;
143 unsigned settings_ack:1;
143144 unsigned blocked:1;
144145 };
145146