diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-08-10 11:02:07 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-08-15 13:16:39 +0200 |
commit | 232ad6549a684505efcbb6ed9d7a78943cc5f817 (patch) | |
tree | 92f16de7818a0592fba40107bea2ceb97166cd58 /lib/url.c | |
parent | 03da3ba1c0c26fa3d7113d469eac992cf972dc5a (diff) |
multi: support timeouts
Curl_expire() is now expanded to hold a list of timeouts for each easy
handle. Only the closest in time will be the one used as the primary
timeout for the handle and will be used for the splay tree (which sorts
and lists all handles within the multi handle).
When the main timeout has triggered/expired, the next timeout in time
that is kept in the list will be moved to the main timeout position and
used as the key to splay with. This way, all timeouts that are set with
Curl_expire() internally will end up as a proper timeout. Previously any
Curl_expire() that set a _later_ timeout than what was already set was
just silently ignored and thus missed.
Setting Curl_expire() with timeout 0 (zero) will cancel all previously
added timeouts.
Corrects known bug #62.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -479,7 +479,15 @@ CURLcode Curl_close(struct SessionHandle *data) if(m) /* This handle is still part of a multi handle, take care of this first and detach this handle from there. */ - Curl_multi_rmeasy(data->multi, data); + curl_multi_remove_handle(data->multi, data); + + /* Destroy the timeout list that is held in the easy handle. It is + /normally/ done by curl_multi_remove_handle() but this is "just in + case" */ + if(data->state.timeoutlist) { + Curl_llist_destroy(data->state.timeoutlist, NULL); + data->state.timeoutlist = NULL; + } data->magic = 0; /* force a clear AFTER the possibly enforced removal from the multi handle, since that function uses the magic |