Mercurial > hg > nginx
comparison src/http/modules/ngx_http_ssl_module.c @ 8921:33226ac61076 quic
HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 06 Dec 2021 13:02:36 +0300 |
parents | 606bf52888d2 |
children | be08b858086a |
comparison
equal
deleted
inserted
replaced
8920:9680f0badc95 | 8921:33226ac61076 |
---|---|
414 static int | 414 static int |
415 ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out, | 415 ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out, |
416 unsigned char *outlen, const unsigned char *in, unsigned int inlen, | 416 unsigned char *outlen, const unsigned char *in, unsigned int inlen, |
417 void *arg) | 417 void *arg) |
418 { | 418 { |
419 #if (NGX_HTTP_QUIC) | 419 #if (NGX_HTTP_V3) |
420 const char *fmt; | 420 const char *fmt; |
421 #endif | 421 #endif |
422 unsigned int srvlen; | 422 unsigned int srvlen; |
423 unsigned char *srv; | 423 unsigned char *srv; |
424 #if (NGX_DEBUG) | 424 #if (NGX_DEBUG) |
425 unsigned int i; | 425 unsigned int i; |
426 #endif | 426 #endif |
427 #if (NGX_HTTP_V2 || NGX_HTTP_QUIC) | 427 #if (NGX_HTTP_V2 || NGX_HTTP_V3) |
428 ngx_http_connection_t *hc; | 428 ngx_http_connection_t *hc; |
429 #endif | 429 #endif |
430 #if (NGX_HTTP_V2 || NGX_HTTP_QUIC || NGX_DEBUG) | 430 #if (NGX_HTTP_V2 || NGX_HTTP_V3 || NGX_DEBUG) |
431 ngx_connection_t *c; | 431 ngx_connection_t *c; |
432 | 432 |
433 c = ngx_ssl_get_connection(ssl_conn); | 433 c = ngx_ssl_get_connection(ssl_conn); |
434 #endif | 434 #endif |
435 | 435 |
439 "SSL ALPN supported by client: %*s", | 439 "SSL ALPN supported by client: %*s", |
440 (size_t) in[i], &in[i + 1]); | 440 (size_t) in[i], &in[i + 1]); |
441 } | 441 } |
442 #endif | 442 #endif |
443 | 443 |
444 #if (NGX_HTTP_V2 || NGX_HTTP_QUIC) | 444 #if (NGX_HTTP_V2 || NGX_HTTP_V3) |
445 hc = c->data; | 445 hc = c->data; |
446 #endif | 446 #endif |
447 | 447 |
448 #if (NGX_HTTP_V2) | 448 #if (NGX_HTTP_V2) |
449 if (hc->addr_conf->http2) { | 449 if (hc->addr_conf->http2) { |
450 srv = (unsigned char *) NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS; | 450 srv = (unsigned char *) NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS; |
451 srvlen = sizeof(NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS) - 1; | 451 srvlen = sizeof(NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS) - 1; |
452 } else | 452 } else |
453 #endif | 453 #endif |
454 #if (NGX_HTTP_QUIC) | 454 #if (NGX_HTTP_V3) |
455 if (hc->addr_conf->quic) { | 455 if (hc->addr_conf->quic) { |
456 #if (NGX_HTTP_V3) | |
457 if (hc->addr_conf->http3) { | 456 if (hc->addr_conf->http3) { |
458 srv = (unsigned char *) NGX_HTTP_V3_ALPN_PROTO; | 457 srv = (unsigned char *) NGX_HTTP_V3_ALPN_PROTO; |
459 srvlen = sizeof(NGX_HTTP_V3_ALPN_PROTO) - 1; | 458 srvlen = sizeof(NGX_HTTP_V3_ALPN_PROTO) - 1; |
460 fmt = NGX_HTTP_V3_ALPN_DRAFT_FMT; | 459 fmt = NGX_HTTP_V3_ALPN_DRAFT_FMT; |
461 | 460 |
462 } else | 461 } else { |
463 #endif | |
464 { | |
465 srv = (unsigned char *) NGX_HTTP_QUIC_ALPN_PROTO; | 462 srv = (unsigned char *) NGX_HTTP_QUIC_ALPN_PROTO; |
466 srvlen = sizeof(NGX_HTTP_QUIC_ALPN_PROTO) - 1; | 463 srvlen = sizeof(NGX_HTTP_QUIC_ALPN_PROTO) - 1; |
467 fmt = NGX_HTTP_QUIC_ALPN_DRAFT_FMT; | 464 fmt = NGX_HTTP_QUIC_ALPN_DRAFT_FMT; |
468 } | 465 } |
469 | 466 |