close tunnel when finish udp data

pull/379/head
cnlh 2020-01-15 22:32:41 +08:00
parent 13d90df9ef
commit b5a0daa69d
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@ func (s *UdpModeServer) process(addr *net.UDPAddr, data []byte) {
return
} else {
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)
buf := common.BufPoolUdp.Get().([]byte)
defer common.BufPoolUdp.Put(buf)