before the connect timeout expires and we must acknowledge whichever
timeout that is reached first. The total timeout is set per entire
operation, while the connect timeout is set per connect. */
- if(data->set.timeout <= 0 && !duringconnect)
+ if((!data->set.timeout || data->set.connect_only) && !duringconnect)
return 0; /* no timeout in place or checked, return "no limit" */
if(!nowp) {
nowp = &now;
}
- if(data->set.timeout > 0) {
+ if(data->set.timeout) {
timeleft_ms = data->set.timeout -
- curlx_timediff(*nowp, data->progress.t_startop);
+ curlx_timediff(*nowp, data->progress.t_startop);
if(!timeleft_ms)
timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
if(!duringconnect)
full response to arrive before we bail out */
timeout_ms = response_time - curlx_timediff(now, pp->response);
- if((data->set.timeout > 0) && !disconnecting) {
+ if(data->set.timeout && !disconnecting) {
/* if timeout is requested, find out how much overall remains */
timediff_t timeout2_ms = Curl_timeleft(data, &now, FALSE);
/* pick the lowest number */