]> git.kaiwu.me - nginx.git/commitdiff
Merged with the default branch.
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 3 Nov 2021 08:22:07 +0000 (11:22 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 3 Nov 2021 08:22:07 +0000 (11:22 +0300)
12 files changed:
1  2 
src/event/ngx_event_openssl.c
src/event/ngx_event_openssl.h
src/http/modules/ngx_http_ssl_module.c
src/http/ngx_http.c
src/http/ngx_http_core_module.c
src/http/ngx_http_core_module.h
src/http/ngx_http_request.c
src/http/ngx_http_request_body.c
src/http/ngx_http_upstream.c
src/http/ngx_http_write_filter_module.c
src/http/v2/ngx_http_v2.h
src/stream/ngx_stream_ssl_module.c

Simple merge
Simple merge
index dbb5905dfe075d7df6c7f770799ab45b8d04cc1d,c633f34641cfee96d3302096d979854c139158c1..f2a85f12e8a981c1405ba03fea8cdf85aec48f42
@@@ -443,49 -438,17 +441,47 @@@ ngx_http_ssl_alpn_select(ngx_ssl_conn_
      }
  #endif
  
 -#if (NGX_HTTP_V2)
 +#if (NGX_HTTP_V2 || NGX_HTTP_QUIC)
      hc = c->data;
 +#endif
  
 +#if (NGX_HTTP_V2)
      if (hc->addr_conf->http2) {
-         srv =
-            (unsigned char *) NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
-         srvlen = sizeof(NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
+         srv = (unsigned char *) NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS;
+         srvlen = sizeof(NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS) - 1;
      } else
 +#endif
 +#if (NGX_HTTP_QUIC)
 +    if (hc->addr_conf->quic) {
 +#if (NGX_HTTP_V3)
 +        if (hc->addr_conf->http3) {
 +            srv = (unsigned char *) NGX_HTTP_V3_ALPN_ADVERTISE;
 +            srvlen = sizeof(NGX_HTTP_V3_ALPN_ADVERTISE) - 1;
 +            fmt = NGX_HTTP_V3_ALPN_DRAFT_FMT;
 +
 +        } else
 +#endif
 +        {
 +            srv = (unsigned char *) NGX_HTTP_QUIC_ALPN_ADVERTISE;
 +            srvlen = sizeof(NGX_HTTP_QUIC_ALPN_ADVERTISE) - 1;
 +            fmt = NGX_HTTP_QUIC_ALPN_DRAFT_FMT;
 +        }
 +
 +        /* QUIC draft */
 +
 +        if (ngx_quic_version(c) > 1) {
 +            srv = ngx_pnalloc(c->pool, sizeof("\x05h3-xx") - 1);
 +            if (srv == NULL) {
 +                return SSL_TLSEXT_ERR_NOACK;
 +            }
 +            srvlen = ngx_sprintf(srv, fmt, ngx_quic_version(c)) - srv;
 +        }
 +
 +    } else
  #endif
      {
-         srv = (unsigned char *) NGX_HTTP_NPN_ADVERTISE;
-         srvlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1;
+         srv = (unsigned char *) NGX_HTTP_ALPN_PROTOS;
+         srvlen = sizeof(NGX_HTTP_ALPN_PROTOS) - 1;
      }
  
      if (SSL_select_next_proto((unsigned char **) out, outlen, srv, srvlen,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge