comparison src/http/ngx_http_request.c @ 8889:61d0fa67b55e quic

Merged with the default branch.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 03 Nov 2021 11:22:07 +0300
parents 7f4b2687ac80 65946a191197
children 0d3bf08eaac0
comparison
equal deleted inserted replaced
8888:6d1488b62dc5 8889:61d0fa67b55e
615 ngx_destroy_pool(r->pool); 615 ngx_destroy_pool(r->pool);
616 return NULL; 616 return NULL;
617 } 617 }
618 618
619 #if (NGX_HTTP_SSL) 619 #if (NGX_HTTP_SSL)
620 if (c->ssl) { 620 if (c->ssl && !c->ssl->sendfile) {
621 r->main_filter_need_in_memory = 1; 621 r->main_filter_need_in_memory = 1;
622 } 622 }
623 #endif 623 #endif
624 624
625 r->main = r; 625 r->main = r;
814 */ 814 */
815 815
816 c->ssl->no_wait_shutdown = 1; 816 c->ssl->no_wait_shutdown = 1;
817 817
818 #if (NGX_HTTP_V2 \ 818 #if (NGX_HTTP_V2 \
819 && (defined TLSEXT_TYPE_application_layer_protocol_negotiation \ 819 && defined TLSEXT_TYPE_application_layer_protocol_negotiation)
820 || defined TLSEXT_TYPE_next_proto_neg))
821 { 820 {
822 unsigned int len; 821 unsigned int len;
823 const unsigned char *data; 822 const unsigned char *data;
824 ngx_http_connection_t *hc; 823 ngx_http_connection_t *hc;
825 824
826 hc = c->data; 825 hc = c->data;
827 826
828 if (hc->addr_conf->http2) { 827 if (hc->addr_conf->http2) {
829 828
830 #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
831 SSL_get0_alpn_selected(c->ssl->connection, &data, &len); 829 SSL_get0_alpn_selected(c->ssl->connection, &data, &len);
832
833 #ifdef TLSEXT_TYPE_next_proto_neg
834 if (len == 0) {
835 SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
836 }
837 #endif
838
839 #else /* TLSEXT_TYPE_next_proto_neg */
840 SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
841 #endif
842 830
843 if (len == 2 && data[0] == 'h' && data[1] == '2') { 831 if (len == 2 && data[0] == 'h' && data[1] == '2') {
844 ngx_http_v2_init(c->read); 832 ngx_http_v2_init(c->read);
845 return; 833 return;
846 } 834 }