mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 03:32:33 +08:00
fix: replace self define "connect timeout" to os.ErrDeadlineExceeded
This commit is contained in:
parent
2cbfac2c89
commit
0321fe93cf
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user