comparison src/http/v2/ngx_http_v2.c @ 7771:02be1baed382

HTTP/2: removed http2_recv_timeout. Instead, the client_header_timeout is now used for HTTP/2 reading. Further, the timeout is changed to be set once till no further data left to read, similarly to how client_header_timeout is used in other places.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Feb 2021 21:52:20 +0300
parents 0a5687a458de
children f790816a0e87
comparison
equal deleted inserted replaced
7770:de0b6f1fe4e4 7771:02be1baed382
633 633
634 634
635 static void 635 static void
636 ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c) 636 ngx_http_v2_handle_connection(ngx_http_v2_connection_t *h2c)
637 { 637 {
638 ngx_int_t rc; 638 ngx_int_t rc;
639 ngx_connection_t *c; 639 ngx_connection_t *c;
640 ngx_http_v2_srv_conf_t *h2scf; 640 ngx_http_v2_srv_conf_t *h2scf;
641 ngx_http_core_srv_conf_t *cscf;
641 642
642 if (h2c->last_out || h2c->processing || h2c->pushing) { 643 if (h2c->last_out || h2c->processing || h2c->pushing) {
643 return; 644 return;
644 } 645 }
645 646
674 return; 675 return;
675 } 676 }
676 677
677 ngx_reusable_connection(c, 1); 678 ngx_reusable_connection(c, 1);
678 679
679 h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
680 ngx_http_v2_module);
681 if (h2c->state.incomplete) { 680 if (h2c->state.incomplete) {
682 ngx_add_timer(c->read, h2scf->recv_timeout); 681 if (!c->read->timer_set) {
682 cscf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
683 ngx_http_core_module);
684 ngx_add_timer(c->read, cscf->client_header_timeout);
685 }
686
683 return; 687 return;
684 } 688 }
685 689
686 ngx_destroy_pool(h2c->pool); 690 ngx_destroy_pool(h2c->pool);
687 691
702 c->read->handler = ngx_http_v2_idle_handler; 706 c->read->handler = ngx_http_v2_idle_handler;
703 707
704 if (c->write->timer_set) { 708 if (c->write->timer_set) {
705 ngx_del_timer(c->write); 709 ngx_del_timer(c->write);
706 } 710 }
711
712 h2scf = ngx_http_get_module_srv_conf(h2c->http_connection->conf_ctx,
713 ngx_http_v2_module);
707 714
708 ngx_add_timer(c->read, h2scf->idle_timeout); 715 ngx_add_timer(c->read, h2scf->idle_timeout);
709 } 716 }
710 717
711 718
4694 } 4701 }
4695 4702
4696 c->destroyed = 0; 4703 c->destroyed = 0;
4697 ngx_reusable_connection(c, 0); 4704 ngx_reusable_connection(c, 0);
4698 4705
4706 if (c->read->timer_set) {
4707 ngx_del_timer(c->read);
4708 }
4709
4699 h2c->pool = ngx_create_pool(h2scf->pool_size, h2c->connection->log); 4710 h2c->pool = ngx_create_pool(h2scf->pool_size, h2c->connection->log);
4700 if (h2c->pool == NULL) { 4711 if (h2c->pool == NULL) {
4701 ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_INTERNAL_ERROR); 4712 ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_INTERNAL_ERROR);
4702 return; 4713 return;
4703 } 4714 }