Explorar o código

Handle multiple UDP packets in socks.

V2Ray %!s(int64=10) %!d(string=hai) anos
pai
achega
1b80a1a85a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      proxy/socks/udp.go

+ 1 - 1
proxy/socks/udp.go

@@ -66,7 +66,7 @@ func (server *SocksServer) handlePacket(conn *net.UDPConn, packet v2net.Packet,
 	ray := server.vPoint.DispatchToOutbound(packet)
 	close(ray.InboundInput())
 
-	if data, ok := <-ray.InboundOutput(); ok {
+	for data := range ray.InboundOutput() {
 		response := &protocol.Socks5UDPRequest{
 			Fragment: 0,
 			Address:  targetAddr,