internal/clientinfo: do not complain about net.ErrClosed

The probeLoop may have closed the connection before readLoop return, and
we don't care about this error. So prevent it from annoying the log.
This commit is contained in:
Cuong Manh Le
2023-10-27 22:02:19 +07:00
committed by Cuong Manh Le
parent d88cf52b4e
commit 44ba6aadd9

View File

@@ -123,6 +123,10 @@ func (m *mdns) readLoop(conn *net.UDPConn) {
if err, ok := err.(*net.OpError); ok && (err.Timeout() || err.Temporary()) {
continue
}
// Do not complain about use of closed network connection.
if errors.Is(err, net.ErrClosed) {
return
}
ctrld.ProxyLogger.Load().Debug().Err(err).Msg("mdns readLoop error")
return
}