curl-library
RE: RE: ARES
Date: Sat, 4 Oct 2003 16:10:30 +0200
On Fri, 3 Oct 2003, Daniel Stenberg wrote:
> Can you see where/why it doesn't get set properly in the case it fails for
> you?
The problem arose since I am using a version of curl_add_multi()
that reuses the handle if already present.
So I had to add there the lines to reinstall the hostcache, which gets
cleared by curl_multi_perform().
Here is what I do now at the beginning of curl_add_multi():
/* scan through the list and check whether 'easy_handle' is already
present *\
/
for (easy = multi->easy.next; easy; easy=easy->next) {
if (easy->easy_handle == easy_handle) {
if (easy->state == CURLM_STATE_COMPLETED) {
/* reset the easy handle */
easy->state = CURLM_STATE_INIT;
/* reinstall hostcache */
if (Curl_global_host_cache_use(easy->easy_handle))
easy->easy_handle->hostcache = Curl_global_host_cache_get();
else
easy->easy_handle->hostcache = multi->hostcache;
return CURLM_CALL_MULTI_PERFORM;
} else
return CURLM_BAD_EASY_HANDLE;
}
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-10-04