From 4aeac0e2275dfec12118f1759151e422a2abde2a Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 23 Apr 2022 08:53:51 +0800 Subject: [PATCH] chore: Adjust the connection IP log --- component/dialer/dialer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/component/dialer/dialer.go b/component/dialer/dialer.go index 4f5d820e..1766f4ad 100644 --- a/component/dialer/dialer.go +++ b/component/dialer/dialer.go @@ -55,7 +55,7 @@ func DialContext(ctx context.Context, network, address string, options ...Option return dialContext(ctx, network, ip, port, opt) case "tcp", "udp": - if TCPConcurrent && network == "tcp" { + if TCPConcurrent { return concurrentDialContext(ctx, network, address, opt) } else { return dualStackDialContext(ctx, network, address, opt) @@ -251,8 +251,7 @@ func concurrentDialContext(ctx context.Context, network, address string, opt *op for res := range results { connCount-- if res.error == nil { - connIp := res.Conn.RemoteAddr() - log.Debugln("[%s] used [%s] connected", host, connIp) + log.Debugln("[%s] used [%s] connected", host, res.ip.String()) return res.Conn, nil }