Mercurial > hg > nginx
diff src/event/ngx_event_quic.c @ 8482:893b3313f53c quic
QUIC: added "quic" listen parameter in Stream.
Also, introduced ngx_stream_quic_module.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 21 Jul 2020 23:08:39 +0300 |
parents | 0d2b2664b41c |
children | 2da9c4fddd44 |
line wrap: on
line diff
--- a/src/event/ngx_event_quic.c Tue Jul 21 23:09:22 2020 +0300 +++ b/src/event/ngx_event_quic.c Tue Jul 21 23:08:39 2020 +0300 @@ -413,20 +413,20 @@ */ #if defined(TLSEXT_TYPE_application_layer_protocol_negotiation) - { - unsigned int len; - const unsigned char *data; - - SSL_get0_alpn_selected(c->ssl->connection, &data, &len); - - if (len == 0) { - qc->error = 0x100 + SSL_AD_NO_APPLICATION_PROTOCOL; - qc->error_reason = "unsupported protocol in ALPN extension"; - - ngx_log_error(NGX_LOG_INFO, c->log, 0, - "quic unsupported protocol in ALPN extension"); - return 0; - } + if (qc->conf->require_alpn) { + unsigned int len; + const unsigned char *data; + + SSL_get0_alpn_selected(c->ssl->connection, &data, &len); + + if (len == 0) { + qc->error = 0x100 + SSL_AD_NO_APPLICATION_PROTOCOL; + qc->error_reason = "unsupported protocol in ALPN extension"; + + ngx_log_error(NGX_LOG_INFO, c->log, 0, + "quic unsupported protocol in ALPN extension"); + return 0; + } } #endif @@ -3882,6 +3882,7 @@ } sn->c->qs = sn; + sn->c->type = SOCK_STREAM; sn->c->pool = pool; sn->c->ssl = c->ssl; sn->c->sockaddr = c->sockaddr;