chore: Adjust the connection IP log

This commit is contained in:
Skyxim 2022-04-23 08:53:51 +08:00
parent bd3c493c9f
commit 4aeac0e227

View file

@ -55,7 +55,7 @@ func DialContext(ctx context.Context, network, address string, options ...Option
return dialContext(ctx, network, ip, port, opt) return dialContext(ctx, network, ip, port, opt)
case "tcp", "udp": case "tcp", "udp":
if TCPConcurrent && network == "tcp" { if TCPConcurrent {
return concurrentDialContext(ctx, network, address, opt) return concurrentDialContext(ctx, network, address, opt)
} else { } else {
return dualStackDialContext(ctx, network, address, opt) return dualStackDialContext(ctx, network, address, opt)
@ -251,8 +251,7 @@ func concurrentDialContext(ctx context.Context, network, address string, opt *op
for res := range results { for res := range results {
connCount-- connCount--
if res.error == nil { if res.error == nil {
connIp := res.Conn.RemoteAddr() log.Debugln("[%s] used [%s] connected", host, res.ip.String())
log.Debugln("[%s] used [%s] connected", host, connIp)
return res.Conn, nil return res.Conn, nil
} }