cURL / Mailing Lists / curl-library / Single Mail

curl-library

Multiple curl handles and URL address

From: sujata singh <sujatasingh_orlando_at_yahoo.com>
Date: Thu, 23 Mar 2006 17:08:51 -0800 (PST)

I am unable to create a sample snippet out of our
application for now. Would the following information
be helpful in debugging the issue that I am facing.
The program flow is as follows:
Step 1 - main program calls a function
Step 2 - In that function, a curl handle is
initialised and set up, curl_easy_perform takes place
successfully. That curl handle is then copied into a
dynamically allocated memory (vector of C++). The
function returns.
Step 3 - On subsequent calls to the function, first
it is made sure that the curl handle for a particular
URL has been called on previous occasion, if exists,
copied back into a temporary curl and then
curl_easy_perform is called on it. But, in this
process somehow the curl_easy_perform somehow seems to
be working on the last URLid that was used for
curl_easy_perform.
Does the dynamically allocated memory copy of curl
handle is loosing the URL id that it is supposed to be
associated with it?
If the URL address is set again on the curl handle,
then it works fine (the persistent connections are
still being used).

--- Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 9 Mar 2006, sujata singh wrote:
>
> Please use a sensible subject in mails.
>
> > I am trying to implement multiple curl handles in
> one program. Each curl
> > handle is intended to be used for an exculsive URL
> address and have a
> > persistent connection. I am finding that even
> though I can use the same curl
> > handle, I have to reset the URL address for it
> between different calls to
> > get to the right destination.
>
> That would mean you've found a libcurl bug as it is
> not supposed to work like
> this, and looking at the code I fail to see how it
> can work like that...
>
> Can you please show us a short fully working example
> source code that shows
> this problem happen?
>
> > Now my question is that don't each curl handle
> have a unique URL address
> > associated with it?
>
> Of course each handle has its own unique URL.
>
> --
> Commercial curl and libcurl Technical Support:
> http://haxx.se/curl.html
>

--- Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 9 Mar 2006, sujata singh wrote:
>
> Please use a sensible subject in mails.
>
> > I am trying to implement multiple curl handles in
> one program. Each curl
> > handle is intended to be used for an exculsive URL
> address and have a
> > persistent connection. I am finding that even
> though I can use the same curl
> > handle, I have to reset the URL address for it
> between different calls to
> > get to the right destination.
>
> That would mean you've found a libcurl bug as it is
> not supposed to work like
> this, and looking at the code I fail to see how it
> can work like that...
>
> Can you please show us a short fully working example
> source code that shows
> this problem happen?
>
> > Now my question is that don't each curl handle
> have a unique URL address
> > associated with it?
>
> Of course each handle has its own unique URL.
>
> --
> Commercial curl and libcurl Technical Support:
> http://haxx.se/curl.html
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on 2006-03-24