From 899372129879b5874ffddca4247fca12d3b7c257 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Fri, 28 Feb 2020 13:09:52 +0300 Subject: Introduced quic_version macro, uint16/uint32 routines ported. --- src/http/ngx_http_request.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/http/ngx_http_request.c') diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index bc2797b21..d40f50496 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -691,13 +691,13 @@ ngx_http_quic_handshake(ngx_event_t *rev) } ngx_int_t flags = *b->pos++; - uint32_t version = ngx_http_v2_parse_uint32(b->pos); - b->pos += 4; + uint32_t version = ngx_quic_parse_uint32(b->pos); + b->pos += sizeof(uint32_t); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, rev->log, 0, "quic flags:%xi version:%xD", flags, version); - if (version != 0xff000018) { + if (version != quic_version) { ngx_log_error(NGX_LOG_INFO, rev->log, 0, "unsupported quic version"); ngx_http_close_connection(c); return; @@ -1117,13 +1117,13 @@ ngx_http_quic_handshake_handler(ngx_event_t *rev) } ngx_int_t flags = *p++; - uint32_t version = ngx_http_v2_parse_uint32(p); - p += 4; + uint32_t version = ngx_quic_parse_uint32(p); + p += sizeof(uint32_t); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, rev->log, 0, "quic flags:%xi version:%xD", flags, version); - if (version != 0xff000018) { + if (version != quic_version) { ngx_log_error(NGX_LOG_INFO, rev->log, 0, "unsupported quic version"); ngx_http_close_connection(c); return; -- cgit