Skip to content

Commit

Permalink
HTTP/2: reuse of connections with incomplete frames.
Browse files Browse the repository at this point in the history
Prodded by Taewoo Kim.
  • Loading branch information
mdounin committed Feb 11, 2021
1 parent 9a3ec20 commit 76672e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/http/v2/ngx_http_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ ngx_http_v2_read_handler(ngx_event_t *rev)
return;
}

if (!h2c->processing && !h2c->pushing) {
ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_NO_ERROR);
return;
}

if (!h2c->goaway) {
h2c->goaway = 1;

Expand Down Expand Up @@ -668,6 +673,8 @@ ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c)
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) {
Expand All @@ -689,7 +696,6 @@ ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c)
#endif

c->destroyed = 1;
ngx_reusable_connection(c, 1);

c->write->handler = ngx_http_empty_handler;
c->read->handler = ngx_http_v2_idle_handler;
Expand Down

0 comments on commit 76672e6

Please sign in to comment.