fix: replace self define "connect timeout" to os.ErrDeadlineExceeded
This commit is contained in:
parent
dfb1454119
commit
9a55e50a14
1 changed files with 2 additions and 2 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -19,7 +20,6 @@ var (
|
||||||
actualDualStackDialContext = serialDualStackDialContext
|
actualDualStackDialContext = serialDualStackDialContext
|
||||||
tcpConcurrent = false
|
tcpConcurrent = false
|
||||||
ErrorInvalidedNetworkStack = errors.New("invalided network stack")
|
ErrorInvalidedNetworkStack = errors.New("invalided network stack")
|
||||||
ErrorConnTimeout = errors.New("connect timeout")
|
|
||||||
fallbackTimeout = 300 * time.Millisecond
|
fallbackTimeout = 300 * time.Millisecond
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ func parallelDialContext(ctx context.Context, network string, ips []netip.Addr,
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if ctx.Err() == context.DeadlineExceeded {
|
if ctx.Err() == context.DeadlineExceeded {
|
||||||
return nil, ErrorConnTimeout
|
return nil, os.ErrDeadlineExceeded
|
||||||
}
|
}
|
||||||
return nil, ctx.Err()
|
return nil, ctx.Err()
|
||||||
case res := <-results:
|
case res := <-results:
|
||||||
|
|
Loading…
Reference in a new issue