cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1969808 ] libcurl dont recognize connection close

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 22 May 2008 13:47:56 -0700

Bugs item #1969808, was opened at 2008-05-22 14:51
Message generated for change (Comment added) made by iturrajoel
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1969808&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: http
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Joel Iturra (iturrajoel)
Assigned to: Daniel Stenberg (bagder)
Summary: libcurl dont recognize connection close

Initial Comment:
Hi,
I am using curl 7.18.1 and I have one problem. I think it is confluence of situations

*) HTTP Server: Weblogic Server 8.1 SP2
*) connection is too bad (very remote location)
*) libcurl dont see the connection is closed

Debug lines:

< HTTP/1.1 302 Moved Temporarily
< Date: Thu, 22 May 2008 18:14:52 GMT
< Location: http://URL/psp/finzp/EMPLOYEE/ERP/h/?tab=DEFAULT
< Server: WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284
< Content-Type: text/html
< Expires: Thu, 01 Dec 1994 16:00:00 GMT
< Transfer-Encoding: chunked
< Connection: Close
* Issue another request to this URL: 'http://URL/psp/finzp/EMPLOYEE/ERP/h/?tab=DEFAULT'
* Examining connection #0 for reuse
* Re-using existing connection! (#0) with host URL
* Connected to URL (IP) port 80 (#0)
> GET /psp/finzp/EMPLOYEE/ERP/h/?tab=DEFAULT HTTP/1.1

As you can see, the server close the connection, but libcurl dont detect and try to use the same #0.
Result, no data received.

(please forgive my english)

Thank you
Joel

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

>Comment By: Joel Iturra (iturrajoel)
Date: 2008-05-22 16:47

Message:
Logged In: YES
user_id=2095540
Originator: YES

wait me few minutes

I am logging to send you a good case and this problem

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

Comment By: Dan Fandrich (dfandrich)
Date: 2008-05-22 16:37

Message:
Logged In: YES
user_id=236775
Originator: NO

I still can't reproduce it, even using those options (see the attached
log). Are you sure you're linking your app with version 7.18.1? Mandriva
2007.1 ships with 7.16.0.

URL: http://127.0.0.1:8990/want/557
* About to connect() to 127.0.0.1 port 8990 (#0)
* Trying 127.0.0.1... * connected
* Connected to 127.0.0.1 (127.0.0.1) port 8990 (#0)
> GET /want/557 HTTP/1.1
Host: 127.0.0.1:8990
Accept: */*
Accept-Encoding: identity

* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 This is a weirdo text message swsclose
< Date: Thu, 09 Nov 2010 14:49:00 GMT
< Location: data/5570002.txt?coolsite=yes
< Server: test-server/fake
< Content-Type: text/html
< Expires: Thu, 01 Dec 1994 16:00:00 GMT
< Transfer-Encoding: chunked
< Connection: Close
<
* Closing connection #0
* Issue another request to this URL:
'http://127.0.0.1:8990/want/data/5570002.txt?coolsite=yes'
* About to connect() to 127.0.0.1 port 8990 (#0)
* Trying 127.0.0.1... * connected
* Connected to 127.0.0.1 (127.0.0.1) port 8990 (#0)
> GET /want/data/5570002.txt?coolsite=yes HTTP/1.1
Host: 127.0.0.1:8990
Accept: */*
Accept-Encoding: identity
Referer: http://127.0.0.1:8990/want/557

* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 Followed here fine swsclose
< Date: Thu, 09 Nov 2010 14:49:00 GMT
< Server: test-server/fake
< Content-Length: 52
<
* Closing connection #0

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

Comment By: Daniel Stenberg (bagder)
Date: 2008-05-22 16:31

Message:
Logged In: YES
user_id=1110
Originator: NO

The output looks strange, as when libcurl leaves a connection open (not
closing it) it says so in the verbose:

"Connection #0 to host example.com left intact"

and your output has no such text. Nor does it show the opposite text
"Closing connection #0" for when libcurl closes a connection.

This gives me the feeling you're seeing something really strange, or you
didn't paste the entire output you got. Does it happen all the time on this
particular URL? Does it ever happen on other URLs?

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

Comment By: Joel Iturra (iturrajoel)
Date: 2008-05-22 16:12

Message:
Logged In: YES
user_id=2095540
Originator: YES

Thanks for the info.

We are using easy interface

Thanks,

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

Comment By: Dan Fandrich (dfandrich)
Date: 2008-05-22 16:09

Message:
Logged In: YES
user_id=236775
Originator: NO

Note that you're not allowed to pass integers into curl_easy_setopt like
that; you have to cast them to long, i.e. (long)1. That's not the source of
the problem, though; curl shouldn't be trying to reuse a connection that's
been closed by the server. Are you using the easy or multi interface?

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

Comment By: Joel Iturra (iturrajoel)
Date: 2008-05-22 15:49

Message:
Logged In: YES
user_id=2095540
Originator: YES

Linux: Mandriva Linux release 2007.1 (Official) for i586
Kernel: 2.6.17-13mdv #1 SMP

(C program, relevant lines)

curl_easy_setopt(curl_handle,CURLOPT_FOLLOWLOCATION,config_obj->redir_auto);
 // true
curl_easy_setopt(curl_handle,CURLOPT_FRESH_CONNECT,1);
curl_easy_setopt(curl_handle,CURLOPT_FORBID_REUSE,1);
curl_easy_setopt(curl_handle,CURLOPT_DNS_CACHE_TIMEOUT,-1);
curl_easy_setopt(curl_handle,CURLOPT_ENCODING,"identity");
curl_easy_setopt(curl_handle,CURLOPT_AUTOREFERER,1);
curl_easy_setopt(curl_handle,CURLOPT_NOPROGRESS,1);
curl_easy_setopt(curl_handle,CURLOPT_VERBOSE,1);
curl_easy_setopt(curl_handle,CURLOPT_COOKIEJAR,cookiejarfile->str);
curl_easy_setopt(curl_handle,CURLOPT_COOKIESESSION,1);
curl_easy_setopt(curl_handle,CURLOPT_NOSIGNAL,1);

Note:
this behavior not always happens and while better connection, better
behavior of the client

How I can test when the connection is broken ?

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

Comment By: Dan Fandrich (dfandrich)
Date: 2008-05-22 15:17

Message:
Logged In: YES
user_id=236775
Originator: NO

This looks a lot like test case 11 in the test suite, which passes fine. I
tried modifying it to more closely match exactly these headers and it still
works fine. What command-line options are you using? What platform is this
on?

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

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

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET