cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl: (18) transfer closed with at least 2727 bytes remaining

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Fri, 21 Feb 2003 00:21:11 -0600

For what it's worth, I tried it a bunch of times too, and always got back around
76Kb, with the /html close tag as the last line in every case. Download "current
speed" at close varied from 142K to 355K... (based in Tulsa, probably going out
via multiple T3's in Dallas :-)

I can't help wondering why you're bothering to close the connection? When curl
exits, your OS will shutdown the connection anyway... As far as I know, keeping
the connection open is only meaningful if you're fetching more than one url from
the same server during a single invocation of curl.

A *browser* will benefit from keeping the connection open, because it will
immediately turn around and grab images, javascript, style sheets, etc from the
same server, after parsing the web page. Curl isn't even attempting to do that
(and that's just fine with me, Daniel :-).

Ralph Mitchell

Daniel Stenberg wrote:

> On Thu, 20 Feb 2003, Richard Chen wrote:
>
> > > I tried it 15 times in a row, and it worked every time.
>
> > Thanks for checking this out. I am surprised that the hanging did not
> > happen to you. I have several people reported hanging in different
> > locations in US. Perhaps you have such a fast internet connection that 64k
> > page is too small to reproduce the problem.
>
> Perhaps, I tried it using my 2.5Mbit/sec ADSL. Anyway, it might also be
> related to a whole truckload of other factors, so it really is too soon to
> rule out anything.
>
> [snip]
>
> > % Total % Received % Xferd Average Speed Time Curr.
> > Dload Upload Total Current Left Speed
> > 100 65538 0 65538 0 0 247 0 --:--:-- 0:04:24 --:--:-- 0
> >
> >
> > Notice that after 4 minutes it was still hanging. What is the timeout for
> > curl fetch?
>
> It has no additional timeout by default, so it can sit there doing nothing
> for quite a while...
>
> > What is it is waiting for?
>
> The server to send the rest of the data or the TCP connection to get closed
> (by the other end).
>
> > The server sent back:
> >
> > HTTP/1.1 200 OK
> > Date: Thu, 20 Feb 2003 17:33:44 GMT
> > Server: Apache/1.3.26 (Unix) mod_ssl/2.8.9 OpenSSL/0.9.6c
> > Set-Cookie: JSESSIONID=YMGX445PAQXN0CQCFUNSFEQKAIWROJYG;path=/
> > Connection: close
> > Transfer-Encoding: chunked
> > Content-Type: text/html; charset="ISO-8859-1"
> >
> > The connection header is to close and there is no spec about how much data
> > is coming back.
>
> Right, but if you fire up ethereal and trace this connection, you'll get some
> details on what happens and I guess that you'll see that the connection is
> not cut off, it just is no data coming.
>
> > Any further idea about what is going on?
>
> Not really. Can you ethereal and see?
>
> What happens if you don't pass along the "Connection: close" header? It
> serves no useful purpose for you here anyway AFAICS...
>
> --
> Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.

-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
Received on 2003-02-21