mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-17 16:26:47 +03:00
Properly handle negative timeouts in client's DoTimeout
This commit is contained in:
@@ -454,6 +454,10 @@ func (c *HostClient) DoTimeout(req *Request, resp *Response, timeout time.Durati
|
||||
}
|
||||
|
||||
func clientDoTimeout(req *Request, resp *Response, timeout time.Duration, c clientDoer) error {
|
||||
if timeout <= 0 {
|
||||
return ErrTimeout
|
||||
}
|
||||
|
||||
deadline := time.Now().Add(timeout)
|
||||
for {
|
||||
err := clientDoTimeoutFreeConn(req, resp, timeout, c)
|
||||
|
||||
Reference in New Issue
Block a user