curl-library
duphandle and multi interface
Date: Sat, 28 Apr 2007 18:45:56 +0200
Hello,
When I have used an easy handle on a multi stack, I can only duplicate
it as long as it belongs to the (living) multi stack. As soon as one
removes it from the multi handle (curl_multi_remove_handle) or cleans up
the whole multi handle (curl_multi_cleanup), it can be no longer
duplicated, because the internal variable
easyhandle->state.interface_used is still set to Curl_if_multi and the
connection cache (state->connc) is NULLed which leads to an abort in
curl_easy_duphandle.
Is this wanted behaviour?
In case it is not, the following patch might be usefull. It simply sets
the interface_used variable to Curl_if_none when the association between
the easy and the multi handle is released.
So far, Ciao, Frank.
*** easy.c.orig 2007-04-09 23:00:57.000000000 +0200
--- easy.c 2007-04-28 18:41:58.000000000 +0200
*************** void Curl_easy_addmulti(struct SessionHa
*** 511,516 ****
--- 511,517 ----
void *multi)
{
data->multi = multi;
+ if (multi == NULL) data->state.used_interface = Curl_if_none;
}
Received on 2007-04-28