diff options
| author | Roman Arutyunyan <arut@nginx.com> | 2020-07-21 23:08:39 +0300 |
|---|---|---|
| committer | Roman Arutyunyan <arut@nginx.com> | 2020-07-21 23:08:39 +0300 |
| commit | 36f2873f6b0d8512c053935614fcc6ae9d969858 (patch) | |
| tree | 5d50f945509b360aeeca15487cb9d28f6a9b09e1 /src/event | |
| parent | b813b9ec358862a2a94868bc057420d6eca5c05d (diff) | |
| download | nginx-36f2873f6b0d8512c053935614fcc6ae9d969858.tar.gz nginx-36f2873f6b0d8512c053935614fcc6ae9d969858.tar.bz2 | |
QUIC: added "quic" listen parameter in Stream.
Also, introduced ngx_stream_quic_module.
Diffstat (limited to 'src/event')
| -rw-r--r-- | src/event/ngx_event_quic.c | 23 | ||||
| -rw-r--r-- | src/event/ngx_event_quic.h | 1 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c index d72052c82..16035bfb5 100644 --- a/src/event/ngx_event_quic.c +++ b/src/event/ngx_event_quic.c @@ -413,20 +413,20 @@ ngx_quic_add_handshake_data(ngx_ssl_conn_t *ssl_conn, */ #if defined(TLSEXT_TYPE_application_layer_protocol_negotiation) - { - unsigned int len; - const unsigned char *data; + if (qc->conf->require_alpn) { + unsigned int len; + const unsigned char *data; - SSL_get0_alpn_selected(c->ssl->connection, &data, &len); + 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"; + 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; - } + ngx_log_error(NGX_LOG_INFO, c->log, 0, + "quic unsupported protocol in ALPN extension"); + return 0; + } } #endif @@ -3882,6 +3882,7 @@ ngx_quic_create_stream(ngx_connection_t *c, uint64_t id, size_t rcvbuf_size) } sn->c->qs = sn; + sn->c->type = SOCK_STREAM; sn->c->pool = pool; sn->c->ssl = c->ssl; sn->c->sockaddr = c->sockaddr; diff --git a/src/event/ngx_event_quic.h b/src/event/ngx_event_quic.h index 882858ed0..151e15cc5 100644 --- a/src/event/ngx_event_quic.h +++ b/src/event/ngx_event_quic.h @@ -87,6 +87,7 @@ typedef struct { typedef struct { ngx_quic_tp_t tp; ngx_flag_t retry; + ngx_flag_t require_alpn; u_char token_key[32]; /* AES 256 */ } ngx_quic_conf_t; |
