cURL / Mailing Lists / curl-library / Single Mail

curl-library

[ curl-Bugs-1003981 ] libcurl timeout + keep-alives

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 05 Aug 2004 07:49:36 -0700

Bugs item #1003981, was opened at 2004-08-05 10:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1003981&group_id=976

Category: http
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Scott Cantor (scantor)
Assigned to: Daniel Stenberg (bagder)
Summary: libcurl timeout + keep-alives

Initial Comment:
I've been tracking a problem in OpenSAML for a while
that I've finally traced to libcurl. We use the library
server-side with a connection pool, and I generally
leave curl handles intact even when various errors
occur, and let libcurl manage the HTTP connections. So
far, so good.

But when a curl timeout is used, and the HTTP requests
I make time out because of a problem on the other end,
libcurl sometimes leaves the HTTP connection open. The
web server, of course, doesn't know about the timeout,
and it eventually sends back an HTTP response of some sort.

Problem is that the next request that uses that curl
handle reuses the HTTP connection, and libcurl gives me
back the wrong HTTP response (the one from the previous
time out), and then the socket buffers the new
response, and it gets returned for the next request,
and so forth. Chaos.

My work-around is to throw the curl handles away when
they time out. And maybe that's fine, but I don't think
it's my responsibility to do that. If it can't tell
what's happening, I think libcurl should probably close
the HTTP connection when it does a client-side timeout
like this.

I've observed the problem specifically on Solaris 2.6
with libcurl 7.10.8. I don't know yet if it affects
later versions.

Scott Cantor
cantor.2_at_osu.edu

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1003981&group_id=976
Received on 2004-08-05