Klaus Demo nginx / 4d4201f
HTTP/2: switched back to RST_STREAM with NO_ERROR. In 8df664ebe037, we've switched to maximizing stream window instead of sending RST_STREAM. Since then handling of RST_STREAM with NO_ERROR was fixed at least in Chrome, hence we switch back to using RST_STREAM. This allows more effective rejecting of large bodies, and also minimizes non-payload traffic to be accounted in the next patch. Maxim Dounin 2 years ago
1 changed file(s) with 0 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
42834283 }
42844284
42854285 } else if (!stream->in_closed) {
4286 #if 0
42874286 if (ngx_http_v2_send_rst_stream(h2c, node->id, NGX_HTTP_V2_NO_ERROR)
42884287 != NGX_OK)
42894288 {
42904289 h2c->connection->error = 1;
42914290 }
4292 #else
4293 /*
4294 * At the time of writing at least the latest versions of Chrome
4295 * do not properly handle RST_STREAM with NO_ERROR status.
4296 *
4297 * See: https://bugs.chromium.org/p/chromium/issues/detail?id=603182
4298 *
4299 * As a workaround, the stream window is maximized before closing
4300 * the stream. This allows a client to send up to 2 GB of data
4301 * before getting blocked on flow control.
4302 */
4303
4304 if (stream->recv_window < NGX_HTTP_V2_MAX_WINDOW
4305 && ngx_http_v2_send_window_update(h2c, node->id,
4306 NGX_HTTP_V2_MAX_WINDOW
4307 - stream->recv_window)
4308 != NGX_OK)
4309 {
4310 h2c->connection->error = 1;
4311 }
4312 #endif
43134291 }
43144292 }
43154293