comparison src/http/modules/ngx_http_ssl_module.c @ 8269:c9c3a73df6e8 quic

Support for HTTP/3 ALPN. This is required by Chrome.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 23 Mar 2020 19:26:24 +0300
parents 253cf267f95a
children 7995cd199b52
comparison
equal deleted inserted replaced
8268:159eb325ec82 8269:c9c3a73df6e8
369 unsigned int srvlen; 369 unsigned int srvlen;
370 unsigned char *srv; 370 unsigned char *srv;
371 #if (NGX_DEBUG) 371 #if (NGX_DEBUG)
372 unsigned int i; 372 unsigned int i;
373 #endif 373 #endif
374 #if (NGX_HTTP_V2) 374 #if (NGX_HTTP_V2 || NGX_HTTP_V3)
375 ngx_http_connection_t *hc; 375 ngx_http_connection_t *hc;
376 #endif 376 #endif
377 #if (NGX_HTTP_V2 || NGX_DEBUG) 377 #if (NGX_HTTP_V2 || NGX_DEBUG)
378 ngx_connection_t *c; 378 ngx_connection_t *c;
379 379
386 "SSL ALPN supported by client: %*s", 386 "SSL ALPN supported by client: %*s",
387 (size_t) in[i], &in[i + 1]); 387 (size_t) in[i], &in[i + 1]);
388 } 388 }
389 #endif 389 #endif
390 390
391 #if (NGX_HTTP_V2 || NGX_HTTP_V3)
392 hc = c->data;
393 #endif
394
391 #if (NGX_HTTP_V2) 395 #if (NGX_HTTP_V2)
392 hc = c->data;
393
394 if (hc->addr_conf->http2) { 396 if (hc->addr_conf->http2) {
395 srv = 397 srv =
396 (unsigned char *) NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE; 398 (unsigned char *) NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
397 srvlen = sizeof(NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1; 399 srvlen = sizeof(NGX_HTTP_V2_ALPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
398 400
401 } else
402 #endif
403 #if (NGX_HTTP_V3)
404 if (hc->addr_conf->http3) {
405 srv = (unsigned char *) NGX_HTTP_V3_ALPN_ADVERTISE;
406 srvlen = sizeof(NGX_HTTP_V3_ALPN_ADVERTISE) - 1;
399 } else 407 } else
400 #endif 408 #endif
401 { 409 {
402 srv = (unsigned char *) NGX_HTTP_NPN_ADVERTISE; 410 srv = (unsigned char *) NGX_HTTP_NPN_ADVERTISE;
403 srvlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1; 411 srvlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1;