# HG changeset patch # User Maxim Dounin # Date 1613069532 -10800 # Node ID fc536dcdbbf776d19ba53bbba4a5009da70b34ff # Parent 6d98f29867e8b24ccf6f35116fae4a5ce903a491 HTTP/2: reuse of connections with incomplete frames. Prodded by Taewoo Kim. diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -362,6 +362,11 @@ ngx_http_v2_read_handler(ngx_event_t *re return; } + if (!h2c->processing && !h2c->pushing) { + ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_NO_ERROR); + return; + } + if (!h2c->goaway) { h2c->goaway = 1; @@ -668,6 +673,8 @@ ngx_http_v2_handle_connection(ngx_http_v return; } + ngx_reusable_connection(c, 1); + h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx, ngx_http_v2_module); if (h2c->state.incomplete) { @@ -689,7 +696,6 @@ ngx_http_v2_handle_connection(ngx_http_v #endif c->destroyed = 1; - ngx_reusable_connection(c, 1); c->write->handler = ngx_http_empty_handler; c->read->handler = ngx_http_v2_idle_handler;