From bf6f761b7c051131287642486501acb9dbcb4df3 Mon Sep 17 00:00:00 2001 From: cnlh Date: Wed, 15 Jan 2020 21:55:20 +0800 Subject: [PATCH] fixes #370 #368 --- server/proxy/udp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/proxy/udp.go b/server/proxy/udp.go index 958e3c26..ab780f79 100755 --- a/server/proxy/udp.go +++ b/server/proxy/udp.go @@ -55,9 +55,10 @@ func (s *UdpModeServer) process(addr *net.UDPAddr, data []byte) { } defer s.task.Client.AddConn() link := conn.NewLink(common.CONN_UDP, s.task.Target.TargetStr, s.task.Client.Cnf.Crypt, s.task.Client.Cnf.Compress, addr.String(), s.task.Target.LocalProxy) - if target, err := s.bridge.SendLinkInfo(s.task.Client.Id, link, s.task); err != nil { + if clientConn, err := s.bridge.SendLinkInfo(s.task.Client.Id, link, s.task); err != nil { return } else { + target := conn.GetConn(clientConn, s.task.Client.Cnf.Crypt, s.task.Client.Cnf.Compress, nil, true) s.task.Flow.Add(int64(len(data)), 0) buf := common.BufPoolUdp.Get().([]byte) defer common.BufPoolUdp.Put(buf)