mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-25 17:45:28 +03:00
Return immediately on ErrDialTimeout when dialing HostClient hosts
This commit is contained in:
@@ -1089,6 +1089,12 @@ func (c *HostClient) dialHostHard() (conn net.Conn, err error) {
|
||||
if err == nil {
|
||||
return conn, nil
|
||||
}
|
||||
if err == ErrDialTimeout {
|
||||
// The function already has been blocked for DefaultDialTimeout,
|
||||
// so let's return the error to the caller instead of waiting
|
||||
// for unspecified time during dialing the remaining hosts.
|
||||
return nil, err
|
||||
}
|
||||
n--
|
||||
}
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user