summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2019-09-18 20:28:09 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2019-09-18 20:28:09 +0300
commit4d4201fafd46bb97c29a9c86733331d8e7479f54 (patch)
tree6bbc6e68e4a1472db8a5775b2c2b5822c250ed87
parent555dc61b543bb1fbc50f45b58a422f519d7065ce (diff)
downloadnginx-4d4201fafd46bb97c29a9c86733331d8e7479f54.tar.gz
nginx-4d4201fafd46bb97c29a9c86733331d8e7479f54.tar.bz2
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.
-rw-r--r--src/http/v2/ngx_http_v2.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c
index 06d8dd911..e3c7bbc34 100644
--- a/src/http/v2/ngx_http_v2.c
+++ b/src/http/v2/ngx_http_v2.c
@@ -4284,33 +4284,11 @@ ngx_http_v2_close_stream(ngx_http_v2_stream_t *stream, ngx_int_t rc)
}
} else if (!stream->in_closed) {
-#if 0
if (ngx_http_v2_send_rst_stream(h2c, node->id, NGX_HTTP_V2_NO_ERROR)
!= NGX_OK)
{
h2c->connection->error = 1;
}
-#else
- /*
- * At the time of writing at least the latest versions of Chrome
- * do not properly handle RST_STREAM with NO_ERROR status.
- *
- * See: https://bugs.chromium.org/p/chromium/issues/detail?id=603182
- *
- * As a workaround, the stream window is maximized before closing
- * the stream. This allows a client to send up to 2 GB of data
- * before getting blocked on flow control.
- */
-
- if (stream->recv_window < NGX_HTTP_V2_MAX_WINDOW
- && ngx_http_v2_send_window_update(h2c, node->id,
- NGX_HTTP_V2_MAX_WINDOW
- - stream->recv_window)
- != NGX_OK)
- {
- h2c->connection->error = 1;
- }
-#endif
}
}