diff options
author | Matthew Holt <[email protected]> | 2022-09-29 10:32:02 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2022-09-29 10:32:02 -0600 |
commit | ab720fb768a2602f940cb7296c34021b5bb6c7e6 (patch) | |
tree | 6dc0608e43ae0ec49f99078e100b963239b0e0fd /listeners.go | |
parent | e2991eb019e36b612be3d7b43ed961c7a7e3841d (diff) | |
download | caddy-ab720fb768a2602f940cb7296c34021b5bb6c7e6.tar.gz caddy-ab720fb768a2602f940cb7296c34021b5bb6c7e6.zip |
core: Fix ListenQUIC listener key conflict
Reported on commit e3e8aabbcf65d37516bb97f9dc0f77df52f8cf55
Abused this change in some bash for loops to rapidly reload config
while making requests and didn't observe any memory or resource leaks.
Diffstat (limited to 'listeners.go')
-rw-r--r-- | listeners.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/listeners.go b/listeners.go index aad6b691c..ea03ca421 100644 --- a/listeners.go +++ b/listeners.go @@ -436,7 +436,7 @@ func ListenPacket(network, addr string) (net.PacketConn, error) { // // TODO: See if we can find a more elegant solution closer to the new NetworkAddress.Listen API. func ListenQUIC(ln net.PacketConn, tlsConf *tls.Config, activeRequests *int64) (quic.EarlyListener, error) { - lnKey := listenerKey(ln.LocalAddr().Network(), ln.LocalAddr().String()) + lnKey := listenerKey("quic+"+ln.LocalAddr().Network(), ln.LocalAddr().String()) sharedEarlyListener, _, err := listenerPool.LoadOrNew(lnKey, func() (Destructor, error) { earlyLn, err := quic.ListenEarly(ln, http3.ConfigureTLSConfig(tlsConf), &quic.Config{ @@ -451,7 +451,6 @@ func ListenQUIC(ln net.PacketConn, tlsConf *tls.Config, activeRequests *int64) ( if err != nil { return nil, err } - return &sharedQuicListener{EarlyListener: earlyLn, key: lnKey}, nil }) if err != nil { |