add comments about either h1 or h2 must be used in the listener

This commit is contained in:
WeidiDeng 2025-04-28 16:57:39 +08:00
parent ff4aae6098
commit 337fc17423
No known key found for this signature in database
GPG Key ID: 25F87CE1741EC7CD

View File

@ -52,6 +52,8 @@ func (h *http2Listener) Accept() (net.Conn, error) {
}, nil }, nil
} }
// impossible both are false, either useH1 or useH2 must be true,
// or else the listener wouldn't be created
return &http2Conn{ return &http2Conn{
h2Expected: h.useH2, h2Expected: h.useH2,
Conn: conn, Conn: conn,