Skip to content

Commit

Permalink
curl_multi_add_handle: set timeouts in closure handles
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bagder committed Oct 19, 2016
1 parent a34c7ce commit 5c3d8d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/multi.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5c3d8d2

Please sign in to comment.