From 337fc174235b1d60642f10c870897f0f2866e738 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Mon, 28 Apr 2025 16:57:39 +0800 Subject: [PATCH] add comments about either h1 or h2 must be used in the listener --- modules/caddyhttp/http2listener.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/caddyhttp/http2listener.go b/modules/caddyhttp/http2listener.go index ff2d499b9..c1088395e 100644 --- a/modules/caddyhttp/http2listener.go +++ b/modules/caddyhttp/http2listener.go @@ -52,6 +52,8 @@ func (h *http2Listener) Accept() (net.Conn, error) { }, nil } + // impossible both are false, either useH1 or useH2 must be true, + // or else the listener wouldn't be created return &http2Conn{ h2Expected: h.useH2, Conn: conn,