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
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 */