Browse Source

add timeout check

pull/15/head
Jason 5 years ago
parent
commit
f391ea9af8
  1. 4
      proxy/socks/udp.go

4
proxy/socks/udp.go

@ -74,7 +74,9 @@ func (h *udpHandler) fetchUDPInput(conn core.UDPConn, input net.PacketConn) {
input.SetDeadline(time.Now().Add(h.timeout))
n, _, err := input.ReadFrom(buf)
if err != nil {
log.Warnf("read remote failed: %v", err)
if err, ok := err.(net.Error); ok && !err.Timeout() {
log.Warnf("read remote failed: %v", err)
}
return
}

Loading…
Cancel
Save