]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_multi_add_handle: set timeouts in closure handles
authorDaniel Stenberg <daniel@haxx.se>
Tue, 18 Oct 2016 15:32:01 +0000 (17:32 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Oct 2016 12:43:49 +0000 (14:43 +0200)
The closure handle only ever has default timeouts set. To improve the
state somewhat we clone the timeouts from each added handle so that the
closure handle always has the same timeouts as the most recently added
easy handle.

Fixes #739

lib/multi.c

index 8e4091687f9282000cab6ef0626b51eb98211e4f..e81f5aadd62f849d480c1cb6618489754b629d4d 100644 (file)
@@ -462,6 +462,14 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi,
      handle is added */
   memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall));
 
+  /* The closure handle only ever has default timeouts set. To improve the
+     state somewhat we clone the timeouts from each added handle so that the
+     closure handle always has the same timeouts as the most recently added
+     easy handle. */
+  multi->closure_handle->set.timeout = data->set.timeout;
+  multi->closure_handle->set.server_response_timeout =
+    data->set.server_response_timeout;
+
   update_timer(multi);
   return CURLM_OK;
 }