mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
simplify destination copy logic
This commit is contained in:
parent
78d682e4d1
commit
e149782025
@ -62,11 +62,10 @@ func (v *Handler) ResolveIP(destination net.Destination) net.Destination {
|
||||
}
|
||||
|
||||
ip := ips[dice.Roll(len(ips))]
|
||||
var newDest net.Destination
|
||||
if destination.Network == net.Network_TCP {
|
||||
newDest = net.TCPDestination(net.IPAddress(ip), destination.Port)
|
||||
} else {
|
||||
newDest = net.UDPDestination(net.IPAddress(ip), destination.Port)
|
||||
newDest := net.Destination{
|
||||
Network: destination.Network,
|
||||
Address: net.IPAddress(ip),
|
||||
Port: destination.Port,
|
||||
}
|
||||
log.Trace(newError("changing destination from ", destination, " to ", newDest))
|
||||
return newDest
|
||||
|
Loading…
Reference in New Issue
Block a user