mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-21 20:19:49 +00:00
fix: update addrMap even when queue is full
This commit is contained in:
parent
f0f900c2dc
commit
a3f53e9761
@ -109,12 +109,13 @@ func (c *ObfsUDPHopServerPacketConn) recvRoutine(i int, conn net.PacketConn) {
|
||||
log.Printf("udphop: routine %d read error: %v", i, err)
|
||||
return
|
||||
}
|
||||
// Update addrMap
|
||||
c.addrMapMutex.Lock()
|
||||
c.addrMap[addr.String()] = addrMapEntry{i, time.Now()}
|
||||
c.addrMapMutex.Unlock()
|
||||
select {
|
||||
case c.recvQueue <- &udpPacket{buf, n, addr}:
|
||||
// Update addrMap
|
||||
c.addrMapMutex.Lock()
|
||||
c.addrMap[addr.String()] = addrMapEntry{i, time.Now()}
|
||||
c.addrMapMutex.Unlock()
|
||||
// Packet sent to queue
|
||||
default:
|
||||
log.Printf("udphop: recv queue full, dropping packet from %s", addr)
|
||||
c.bufPool.Put(buf)
|
||||
|
Loading…
x
Reference in New Issue
Block a user