aboutsummaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-06-04 13:22:40 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-06-04 13:22:40 +0200
commit0bf5ce77aabe7307e41db13a0d03a63517fdc366 (patch)
tree4327e3094f0afdc4d391c9024deac4b720c63364 /lib/multi.c
parent159d34b58e9b7771efe254949895d8f6253670db (diff)
curl_multi_wait: only use internal timer if not -1
commit 29bf0598aad5 introduced a problem when the "internal" timeout is prefered to the given if shorter, as it didn't consider the case where -1 was returned. Now the internal timeout is only considered if not -1. Reported-by: Tor Arntsen Bug: http://curl.haxx.se/mail/lib-2013-06/0015.html
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c5
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 */