mirror of
https://github.com/ehang-io/nps.git
synced 2025-07-03 04:53:50 +00:00
close tunnel when finish udp data
This commit is contained in:
parent
13d90df9ef
commit
b5a0daa69d
@ -59,6 +59,7 @@ func (s *UdpModeServer) process(addr *net.UDPAddr, data []byte) {
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
target := conn.GetConn(clientConn, s.task.Client.Cnf.Crypt, s.task.Client.Cnf.Compress, nil, true)
|
target := conn.GetConn(clientConn, s.task.Client.Cnf.Crypt, s.task.Client.Cnf.Compress, nil, true)
|
||||||
|
defer target.Close()
|
||||||
s.task.Flow.Add(int64(len(data)), 0)
|
s.task.Flow.Add(int64(len(data)), 0)
|
||||||
buf := common.BufPoolUdp.Get().([]byte)
|
buf := common.BufPoolUdp.Get().([]byte)
|
||||||
defer common.BufPoolUdp.Put(buf)
|
defer common.BufPoolUdp.Put(buf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user