aboutsummaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-27 22:32:51 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-28 00:07:12 +0200
commita691e044705f12715fcd3310a9832dd5de79bff0 (patch)
treeb28f8575c2cdc608f84399454246c78a49eb1247 /lib/easy.c
parent3d1a453d887a6272f48c241af6190d17891aef02 (diff)
multi_socket: improved 100-continue timeout handling
When waiting for a 100-continue response from the server, the Curl_readwrite() will refuse to run if called until the timeout has been reached. We timeout code in multi_socket() allows code to run slightly before the actual timeout time, so for test 154 it could lead to the function being executed but refused in Curl_readwrite() and then the application would just sit idling forever. This was detected with runtests.pl -e on test 154.
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/easy.c b/lib/easy.c
index b7507019b..32a61a9f8 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -489,7 +489,6 @@ static int events_timer(CURLM *multi, /* multi handle */
ev->ms = timeout_ms;
ev->msbump = TRUE;
- /* fprintf(stderr, "%s: timeout %ld\n", __func__, timeout_ms); */
return 0;
}
@@ -647,8 +646,6 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
/* get the time stamp to use to figure out how long poll takes */
before = curlx_tvnow();
- /* fprintf(stderr, "poll(), %d numfds\n", numfds); */
-
/* wait for activity or timeout */
pollrc = Curl_poll(fds, numfds, (int)ev->ms);
@@ -793,15 +790,14 @@ static CURLcode easy_transfer(CURLM *multi)
* DEBUG: if 'events' is set TRUE, this function will use a replacement engine
* instead of curl_multi_perform() and use curl_multi_socket_action().
*/
-static CURLcode easy_perform(CURL *easy, bool events)
+static CURLcode easy_perform(struct SessionHandle *data, bool events)
{
CURLM *multi;
CURLMcode mcode;
CURLcode code = CURLE_OK;
- struct SessionHandle *data = easy;
SIGPIPE_VARIABLE(pipe_st);
- if(!easy)
+ if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT;
if(data->multi) {
@@ -823,7 +819,7 @@ static CURLcode easy_perform(CURL *easy, bool events)
/* Copy the MAXCONNECTS option to the multi handle */
curl_multi_setopt(multi, CURLMOPT_MAXCONNECTS, data->set.maxconnects);
- mcode = curl_multi_add_handle(multi, easy);
+ mcode = curl_multi_add_handle(multi, data);
if(mcode) {
curl_multi_cleanup(multi);
if(mcode == CURLM_OUT_OF_MEMORY)
@@ -843,7 +839,7 @@ static CURLcode easy_perform(CURL *easy, bool events)
/* ignoring the return code isn't nice, but atm we can't really handle
a failure here, room for future improvement! */
- (void)curl_multi_remove_handle(multi, easy);
+ (void)curl_multi_remove_handle(multi, data);
sigpipe_restore(&pipe_st);