comparison src/http/v2/ngx_http_v2.c @ 7768:fc536dcdbbf7

HTTP/2: reuse of connections with incomplete frames. Prodded by Taewoo Kim.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Feb 2021 21:52:12 +0300
parents 3e83336cda5b
children 0a5687a458de
comparison
equal deleted inserted replaced
7767:6d98f29867e8 7768:fc536dcdbbf7
360 if (c->error) { 360 if (c->error) {
361 ngx_http_v2_finalize_connection(h2c, 0); 361 ngx_http_v2_finalize_connection(h2c, 0);
362 return; 362 return;
363 } 363 }
364 364
365 if (!h2c->processing && !h2c->pushing) {
366 ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_NO_ERROR);
367 return;
368 }
369
365 if (!h2c->goaway) { 370 if (!h2c->goaway) {
366 h2c->goaway = 1; 371 h2c->goaway = 1;
367 372
368 if (ngx_http_v2_send_goaway(h2c, NGX_HTTP_V2_NO_ERROR) 373 if (ngx_http_v2_send_goaway(h2c, NGX_HTTP_V2_NO_ERROR)
369 == NGX_ERROR) 374 == NGX_ERROR)
666 if (h2c->goaway) { 671 if (h2c->goaway) {
667 ngx_http_v2_lingering_close(c); 672 ngx_http_v2_lingering_close(c);
668 return; 673 return;
669 } 674 }
670 675
676 ngx_reusable_connection(c, 1);
677
671 h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx, 678 h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
672 ngx_http_v2_module); 679 ngx_http_v2_module);
673 if (h2c->state.incomplete) { 680 if (h2c->state.incomplete) {
674 ngx_add_timer(c->read, h2scf->recv_timeout); 681 ngx_add_timer(c->read, h2scf->recv_timeout);
675 return; 682 return;
687 ngx_ssl_free_buffer(c); 694 ngx_ssl_free_buffer(c);
688 } 695 }
689 #endif 696 #endif
690 697
691 c->destroyed = 1; 698 c->destroyed = 1;
692 ngx_reusable_connection(c, 1);
693 699
694 c->write->handler = ngx_http_empty_handler; 700 c->write->handler = ngx_http_empty_handler;
695 c->read->handler = ngx_http_v2_idle_handler; 701 c->read->handler = ngx_http_v2_idle_handler;
696 702
697 if (c->write->timer_set) { 703 if (c->write->timer_set) {