Commit 753d44fa authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl_multi_wait: accept 0 from multi_timeout() as valid timeout

The code rejected 0 as a valid timeout while in fact the function could
indeed legitimately return that and it should be respected.

Reported-by: Bjorn Stenberg
parent cfdfdcdd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -787,9 +787,9 @@ CURLMcode curl_multi_wait(CURLM *multi_handle,

  /* If the internally desired timeout is actually shorter than requested from
     the outside, then use the shorter time! But only if the internal timer
     is actually larger than 0! */
     is actually larger than -1! */
  (void)multi_timeout(multi, &timeout_internal);
  if((timeout_internal > 0) && (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 */