mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-07 21:09:55 +00:00
fix: udp hop returning bogus close errors
This commit is contained in:
parent
6bcb00a0cc
commit
ee70476030
@ -83,7 +83,13 @@ func (u *udpHopPacketConn) recvLoop(conn net.PacketConn) {
|
||||
n, addr, err := conn.ReadFrom(buf)
|
||||
if err != nil {
|
||||
u.bufPool.Put(buf)
|
||||
u.recvQueue <- &udpPacket{nil, 0, nil, err}
|
||||
var netErr net.Error
|
||||
if errors.As(err, &netErr) && netErr.Timeout() {
|
||||
// Only pass through timeout errors here, not permanent errors
|
||||
// like connection closed. Connection close is normal as we close
|
||||
// the old connection to exit this loop every time we hop.
|
||||
u.recvQueue <- &udpPacket{nil, 0, nil, netErr}
|
||||
}
|
||||
return
|
||||
}
|
||||
select {
|
||||
|
Loading…
x
Reference in New Issue
Block a user