cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Richard Chen <richard_at_doubleprime.com>
Date: Thu, 20 Feb 2003 10:08:56 -0500

On Thu, Feb 20, 2003 at 03:52:49PM +0100, Daniel Stenberg wrote:
> On Thu, 20 Feb 2003, Richard Chen wrote:
>
> > I got a message when I explicitly specify not to use keep alive:
> >
> > curl --header 'Connection: close' -i -v <url>
> >
> > Since keep alive is used for multiple url transfers,
>
> "Keep alive" is always used for HTTP 1.1, but it shouldn't cause you any
> problems so disabling it should not be needed.
>
> > I expect that the transfer will be finished completely. But I got the
> > message:
> >
> > curl: (18) transfer closed with at least 2727 bytes remaining
> >
> > If curl knows about how much data to receive and the server will send out
> > those data before closing, how can the above error occur?
>
> The server will tell the client how many bytes to expect. The client
> downloads the data and counts the amount received.
>
> When the connection is closed, the client can easily see if the two different
> amounts differ. And then it says this.
>
> > Is 'keep alive' always needed?
>
> No. And you'll see that you won't get this problem when you try this on more
> servers. I just did and I can't make it fail...
>
> --
> Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
>

Here is an example where the curl download will stall and eventually timeout:
(You may have to try it 3 or 4 times to encounter a hanging situation)

$ curl --header 'Connection: close' -o foo.html -i -v 'http://www.esteelauder.de/prod_dir/multi_prod_non_color_sorting.jhtml?categoryId=CAT1024&startIndex=1&pageNumber=1'
* Connected to 66.54.6.78 (66.54.6.78) port 80
> GET /prod_dir/multi_prod_non_color_sorting.jhtml?categoryId=CAT1024&startIndex=1&pageNumber=1 HTTP/1.1
User-Agent: curl/7.9.5 (i386-redhat-linux-gnu) libcurl 7.9.5 (OpenSSL 0.9.6b) (ipv6 enabled)
Host: www.esteelauder.de
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Connection: close

  % Total % Received % Xferd Average Speed Time Curr.
                                 Dload Upload Total Current Left Speed
100 61447 0 61447 0 0 3945 0 --:--:-- 0:01:15 --:--:-- 0

What happens is that the speed continuously decrease until reaching zero.

Notice that the downloaded amount is very close to 64k. I wonder if
there is some kind of size limit somewhere imposed.

Thanks

Richard

-------------------------------------------------------
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-20