mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-02 03:57:38 +03:00
fix: udp hop returning bogus close errors
This commit is contained in:
parent
6bcb00a0cc
commit
ee70476030
1 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue