diff options
-rw-r--r-- | lib/multi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/multi.c b/lib/multi.c index e4b336964..12c6a344b 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -818,9 +818,10 @@ CURLMcode curl_multi_wait(CURLM *multi_handle, return CURLM_BAD_HANDLE; /* If the internally desired timeout is actually shorter than requested from - the outside, then use the shorter time! */ + the outside, then use the shorter time! But only if the internal timer + is actually larger than 0! */ (void)multi_timeout(multi, &timeout_internal); - if(timeout_internal < (long)timeout_ms) + if((timeout_internal > 0) && (timeout_internal < (long)timeout_ms)) timeout_ms = (int)timeout_internal; /* Count up how many fds we have from the multi handle */ |