cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Commonalities between cURL instances

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 7 Mar 2002 00:15:12 +0100 (MET)

On Wed, 6 Mar 2002, David Burley wrote:

> I am facing an issue with cURL that I am attributing to "sharing" of
> data/connections between cURL instances.

You should probably present the problem to us as well, as it might help us
understand what you're after or possibly recognize something we might know
how to fix.

> One thing that I think I found in the cURL code, which I am not to familiar
> with, is that it seems cURL caches the SSL connection information for
> future use.

The SSL session ID is cached to reduce re-connection time (the SSL
handshake), should a subsequent request be made to the same host after the
connection has been closed.

But libcurl also caches connections, which makes it attempt to keep
connections alive to be able to re-use it in a subsequent request. If a
connection is re-used, the SSL session ID isn't needed as it doesn't have to
redo the SSL handshake.

> So, if I ran to copies of cURL both to the same site at about the same
> time... I believe they would use the same SSL connection.

No. The sharing is only made within a single curl easy handle, and it can
only be used sequentially by a single program.

> Presuming I explicitly gave each instance their own cookie file and post
> data, what else might they share?

Two separate curl processes don't share anything.

> Do they even share the SSL connection that I think they are?

No.

> If they are sharing data, how do I get it to stop?

Two separate curl processes will never share data.

> If I use libcURL will I get the same results as with cURL itself?

If you use libcurl the right way and the same way the curl tool does, you
will get the same results indeed.

Using libcurl is often slightly more error-prone than using the curl tool, as
people tend to do more mistakes when they program than when they simple use a
command line tool.

I hope this helps. If you have specific libcurl issues, please take them on
the libcurl mailing list.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-07