aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/connect.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c
index e440913e9..e178633d8 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -174,6 +174,9 @@ long Curl_timeleft(struct connectdata *conn,
/* substract elapsed time */
timeout_ms -= Curl_tvdiff(*nowp, data->progress.t_startsingle);
+ if(!timeout_ms)
+ /* avoid returning 0 as that means no timeout! */
+ return -1;
return timeout_ms;
}