mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-18 08:20:53 +00:00
fix(listener/tproxy): possilly using released buffer in tproxy
This commit is contained in:
parent
43bdc76f87
commit
f8c3b5d030
1 changed files with 3 additions and 1 deletions
|
@ -105,11 +105,13 @@ func listenLocalConn(rAddr, lAddr net.Addr, tunnel C.Tunnel) (*net.UDPConn, erro
|
|||
buf := pool.Get(pool.UDPBufferSize)
|
||||
br, err := lc.Read(buf)
|
||||
if err != nil {
|
||||
pool.Put(buf)
|
||||
if errors.Is(err, net.ErrClosed) {
|
||||
log.Debugln("TProxy local conn listener exit.. rAddr=%s lAddr=%s", rAddr.String(), lAddr.String())
|
||||
pool.Put(buf)
|
||||
return
|
||||
}
|
||||
|
||||
log.Debugln("TProxy local conn read err=%v", err)
|
||||
}
|
||||
// since following localPackets are pass through this socket which listen rAddr
|
||||
// I choose current listener as packet's packet conn
|
||||
|
|
Loading…
Add table
Reference in a new issue