diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-02-01 21:42:44 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-02-01 21:42:44 +0000 |
commit | 55f1e787f34cd3d86aa3d6bf981f077de86be265 (patch) | |
tree | a1c1dcbf05a0e54af3cbeec6da49c39d6542c87e /lib | |
parent | 516cf5c8ddd6a094babdf4ee2d3b2fa4c7a48b0e (diff) | |
download | curl-55f1e787f34cd3d86aa3d6bf981f077de86be265.tar.gz |
We introduce a loop in lib/multi.c around all calls to multi_runsingle() and
simply check for CURLM_CALL_MULTI_PERFORM internally. This has the added
benefit that this goes in line with my long-term wishes to get rid of the
CURLM_CALL_MULTI_PERFORM all together from the public API.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/multi.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/multi.c b/lib/multi.c index d9414b9eb..5d19b089b 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1568,17 +1568,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, multi->num_msgs++; /* increase message counter */ } - if(CURLM_CALL_MULTI_PERFORM == result) - /* Set the timeout for this handle to expire really soon so that it will - be taken care of even when this handle is added in the midst of - operation when only the curl_multi_socket() API is used. During that - flow, only sockets that time-out or have actions will be dealt - with. Since this handle has no action yet, we make sure it times out to - get things to happen. Also, this makes it less important for callers of - the curl_multi_* functions to bother about the CURLM_CALL_MULTI_PERFORM - return code, as long as they deal with the timeouts properly. */ - Curl_expire(easy->easy_handle, 1); - return result; } @@ -1597,7 +1586,10 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles) while(easy != &multi->easy) { CURLMcode result; - result = multi_runsingle(multi, easy); + do + result = multi_runsingle(multi, easy); + while (CURLM_CALL_MULTI_PERFORM == result); + if(result) returncode = result; @@ -1956,7 +1948,9 @@ static CURLMcode multi_socket(struct Curl_multi *multi, if(data->set.one_easy->easy_conn) /* set socket event bitmask */ data->set.one_easy->easy_conn->cselect_bits = ev_bitmask; - result = multi_runsingle(multi, data->set.one_easy); + do + result = multi_runsingle(multi, data->set.one_easy); + while (CURLM_CALL_MULTI_PERFORM == result); if(data->set.one_easy->easy_conn) data->set.one_easy->easy_conn->cselect_bits = 0; @@ -1985,7 +1979,9 @@ static CURLMcode multi_socket(struct Curl_multi *multi, /* the first loop lap 'data' can be NULL */ if(data) { - result = multi_runsingle(multi, data->set.one_easy); + do + result = multi_runsingle(multi, data->set.one_easy); + while (CURLM_CALL_MULTI_PERFORM == result); if(CURLM_OK >= result) /* get the socket(s) and check if the state has been changed since |