From 0321fe93cf459471ed585dc428fd77eed87da9f0 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Sun, 26 Feb 2023 13:05:55 +0800 Subject: [PATCH] fix: replace self define "connect timeout" to os.ErrDeadlineExceeded --- component/dialer/dialer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/component/dialer/dialer.go b/component/dialer/dialer.go index 1925e86c..b9c897d2 100644 --- a/component/dialer/dialer.go +++ b/component/dialer/dialer.go @@ -6,6 +6,7 @@ import ( "fmt" "net" "net/netip" + "os" "strings" "sync" "time" @@ -19,7 +20,6 @@ var ( actualDualStackDialContext = serialDualStackDialContext tcpConcurrent = false ErrorInvalidedNetworkStack = errors.New("invalided network stack") - ErrorConnTimeout = errors.New("connect timeout") fallbackTimeout = 300 * time.Millisecond ) @@ -257,7 +257,7 @@ func parallelDialContext(ctx context.Context, network string, ips []netip.Addr, return nil, err } if ctx.Err() == context.DeadlineExceeded { - return nil, ErrorConnTimeout + return nil, os.ErrDeadlineExceeded } return nil, ctx.Err() case res := <-results: