aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-10-08 21:42:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-10-08 21:42:29 +0000
commit544f2f74dfa7ef9bdb08b098995e61c1ca0e1aca (patch)
tree1e506f0bd1f5fbc300731dafbb97cd1d77f7f50d /lib
parent450348d6bd8a9d0fc22eb53f066443b5d0180113 (diff)
- Igor filed bug #2111613 (http://curl.haxx.se/bug/view.cgi?id=2111613) that
eventually identified a flaw in how the multi_socket interface in some cases missed to call the timeout callback when easy interfaces are removed and added within the same millisecond.
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 6eda8c1c8..63db12a21 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -532,6 +532,18 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
/* increase the alive-counter */
multi->num_alive++;
+ /* A somewhat crude work-around for a little glitch in update_timer() that
+ happens if the lastcall time is set to the same time when the handle is
+ removed as when the next handle is added, as then the check in
+ update_timer() that prevents calling the application multiple times with
+ the same timer infor will not trigger and then the new handle's timeout
+ will not be notified to the app.
+
+ The work-around is thus simply to clear the 'lastcall' variable to force
+ update_timer() to always trigger a callback to the app when a new easy
+ handle is added */
+ memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall));
+
update_timer(multi);
return CURLM_OK;
}
@@ -1013,9 +1025,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
easy->easy_handle->set.errorbuffer[0] = '\0';
easy->easy_handle->state.errorbuf = FALSE;
- easy->result = CURLE_OK;
- result = CURLM_CALL_MULTI_PERFORM;
- multistate(easy, CURLM_STATE_CONNECT);
+ easy->result = CURLE_OK;
+ result = CURLM_CALL_MULTI_PERFORM;
+ multistate(easy, CURLM_STATE_CONNECT);
}
else if (CURLE_OK == easy->result) {
if(!easy->easy_conn->bits.tunnel_connecting)