aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-16 00:16:49 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-18 15:39:28 +0200
commitec5d0991ccf1e04fc384b312fc1b24c21259c0f1 (patch)
tree466d3f231b528c5dc5de5017a87781911cf503d2
parentef38059f7e88ea97421022168701263b4319a81e (diff)
curl_multi_wait: call getsock before figuring out timeout
.... since getsock may update the expiry timer. Fixes #2996 Closes #3000
-rw-r--r--lib/multi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 066adfed3..2faeaa74f 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1010,13 +1010,6 @@ CURLMcode curl_multi_wait(struct Curl_multi *multi,
if(multi->in_callback)
return CURLM_RECURSIVE_API_CALL;
- /* 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 -1! */
- (void)multi_timeout(multi, &timeout_internal);
- 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 */
data = multi->easyp;
while(data) {
@@ -1041,6 +1034,13 @@ CURLMcode curl_multi_wait(struct Curl_multi *multi,
data = data->next; /* check next 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 -1! */
+ (void)multi_timeout(multi, &timeout_internal);
+ if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms))
+ timeout_ms = (int)timeout_internal;
+
curlfds = nfds; /* number of internal file descriptors */
nfds += extra_nfds; /* add the externally provided ones */