From 683aad75dad96e504df928cd28e6787ef68e2e86 Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Fri, 3 Feb 2023 23:23:57 +0800 Subject: [PATCH] Nits (#2293) --- dnscrypt-proxy/xtransport.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index 28e5094a..8cfdaa85 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -506,14 +506,14 @@ func (xTransport *XTransport) Fetch( altPort := uint16(port & 0xffff) for i, xalt := range alt { for j, v := range strings.Split(xalt, ";") { - if i > 8 || j > 16 { + if i >= 8 || j >= 16 { break } v = strings.TrimSpace(v) if strings.HasPrefix(v, "h3=\":") { v = strings.TrimPrefix(v, "h3=\":") v = strings.TrimSuffix(v, "\"") - if xAltPort, err := strconv.ParseUint(v, 10, 16); err == nil && xAltPort <= 65536 { + if xAltPort, err := strconv.ParseUint(v, 10, 16); err == nil && xAltPort <= 65535 { altPort = uint16(xAltPort) dlog.Debugf("Using HTTP/3 for [%s]", url.Host) break