}
-uint32_t
-ngx_quic_version(ngx_connection_t *c)
-{
- uint32_t version;
- ngx_quic_connection_t *qc;
-
- qc = ngx_quic_get_connection(c);
-
- version = qc->version;
-
- return (version & 0xff000000) == 0xff000000 ? version & 0xff : version;
-}
const char *reason);
ngx_int_t ngx_quic_reset_stream(ngx_connection_t *c, ngx_uint_t err);
ngx_int_t ngx_quic_shutdown_stream(ngx_connection_t *c, int how);
-uint32_t ngx_quic_version(ngx_connection_t *c);
ngx_int_t ngx_quic_handle_read_event(ngx_event_t *rev, ngx_uint_t flags);
ngx_int_t ngx_quic_handle_write_event(ngx_event_t *wev, size_t lowat);
ngx_int_t ngx_quic_get_packet_dcid(ngx_log_t *log, u_char *data, size_t len,
unsigned char *outlen, const unsigned char *in, unsigned int inlen,
void *arg)
{
-#if (NGX_HTTP_V3)
- const char *fmt;
-#endif
unsigned int srvlen;
unsigned char *srv;
#if (NGX_DEBUG)
if (h3scf->hq) {
srv = (unsigned char *) NGX_HTTP_V3_HQ_ALPN_PROTO;
srvlen = sizeof(NGX_HTTP_V3_HQ_ALPN_PROTO) - 1;
- fmt = NGX_HTTP_V3_HQ_ALPN_DRAFT_FMT;
} else
#endif
{
srv = (unsigned char *) NGX_HTTP_V3_ALPN_PROTO;
srvlen = sizeof(NGX_HTTP_V3_ALPN_PROTO) - 1;
- fmt = NGX_HTTP_V3_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
#define NGX_HTTP_V3_ALPN_PROTO "\x02h3"
-#define NGX_HTTP_V3_ALPN_DRAFT_FMT "\x05h3-%02uD"
-
#define NGX_HTTP_V3_HQ_ALPN_PROTO "\x0Ahq-interop"
-#define NGX_HTTP_V3_HQ_ALPN_DRAFT_FMT "\x05hq-%02uD"
#define NGX_HTTP_V3_VARLEN_INT_LEN 4
#define NGX_HTTP_V3_PREFIX_INT_LEN 11