mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-23 21:19:55 +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)
|
log.Printf("udphop: routine %d read error: %v", i, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
select {
|
|
||||||
case c.recvQueue <- &udpPacket{buf, n, addr}:
|
|
||||||
// Update addrMap
|
// Update addrMap
|
||||||
c.addrMapMutex.Lock()
|
c.addrMapMutex.Lock()
|
||||||
c.addrMap[addr.String()] = addrMapEntry{i, time.Now()}
|
c.addrMap[addr.String()] = addrMapEntry{i, time.Now()}
|
||||||
c.addrMapMutex.Unlock()
|
c.addrMapMutex.Unlock()
|
||||||
|
select {
|
||||||
|
case c.recvQueue <- &udpPacket{buf, n, addr}:
|
||||||
|
// Packet sent to queue
|
||||||
default:
|
default:
|
||||||
log.Printf("udphop: recv queue full, dropping packet from %s", addr)
|
log.Printf("udphop: recv queue full, dropping packet from %s", addr)
|
||||||
c.bufPool.Put(buf)
|
c.bufPool.Put(buf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user