curl-library
re-using old HTTP connection causes empty reply
Date: Mon, 12 May 2003 13:12:58 -0400
I am not sure this is a libcurl problem per se, but may be a network,
socket, or perhaps webserver problem.
This is a case where trying to reuse an old connection causes an
"empty reply" instead of an I/O error. Have any of you seen this
before?
On the client: libcurl 7.10.1 on Redhat 7.2,
talking to server: ibmhttpd IBM_HTTP_SERVER/1.3.19 Apache/1.3.20 (Unix)
running on Solaris 8 (SunOS 5.8) on a Sparc
As you can see below in the sanitized libcurl log, a connection
is successfully used to do an HTTP fetch. The connection is then not
used for two days (the interval could shorter than that).
On the next fetch, libcurl attempts to reuse the connection. It gets
an "Empty reply from server". But there is no I/O error, and libcurl
saves the connection for reuse.
I have worked around this problem by setting CURLOPT_FORBID_REUSE.
But I don't understand why the old connection is not failing in a way
that would cause it not to be reused. No error appears when
transmitting the "GET" request. I would guess the server had closed
its end of the connection long ago. Perhaps it's not really closed, or
perhaps the client has not noticed for some reason. But why?
Thanks for any insight,
Dan Halbert
==============================================================================
2003-05-09-18:52:31.060 Connection #0 left intact
2003-05-09-18:52:31.090 Re-using existing connection! (#0)
2003-05-09-18:52:31.090 Connected to foo.bar.com (222.222.222.222) port 80
2003-05-09-18:52:31.090 GET something.xml HTTP/1.1
Host: 222.222.222.222
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
2003-05-09-18:52:31.113 HTTP/1.1 200 OK
2003-05-09-18:52:31.114 Date: Fri, 09 May 2003 23:48:12 GMT
2003-05-09-18:52:31.114 Server: IBM_HTTP_SERVER/1.3.19 Apache/1.3.20 (Unix)
2003-05-09-18:52:31.114 Last-Modified: Mon, 17 Feb 2003 16:25:32 GMT
2003-05-09-18:52:31.114 ETag: "zzz-zzz-zzzzz"
2003-05-09-18:52:31.114 Accept-Ranges: bytes
2003-05-09-18:52:31.114 Content-Length: 1047
2003-05-09-18:52:31.114 Content-Type: text/xml
2003-05-09-18:52:31.114 <?xml version="1.0"?>
[contents of something.xml here]
2003-05-09-18:52:31.114 Connection #0 left intact
2003-05-11-03:12:36.075 Re-using existing connection! (#0)
2003-05-11-03:12:36.076 Connected to foo.bar.com (222.222.222.222) port 80
2003-05-11-03:12:36.076 GET something_else.xml HTTP/1.1
Host: 222.222.222.222
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
2003-05-11-03:12:36.089 Empty reply from server
2003-05-11-03:12:36.089 Connection #0 left intact
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
Received on 2003-05-12