Browse Source

optimize timeout check

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

5
proxy/socks/udp.go

@ -74,9 +74,10 @@ 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 {
if err, ok := err.(net.Error); ok && !err.Timeout() {
log.Warnf("read remote failed: %v", err)
if err, ok := err.(net.Error); ok && err.Timeout() {
return
}
log.Warnf("read remote failed: %v", err)
return
}

Loading…
Cancel
Save