cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: 7.16.0 regression with large files

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 12 Jan 2007 23:37:43 +0100 (CET)

On Thu, 11 Jan 2007, Toby Peterson wrote:

> It is related to the bytestoread value that's passed to Curl_read(). This
> small patch fixes the issue, though it's a very poor fix:

Thanks for your report and work on this.

To me, a fix like this below seems like the right thing. I did it on CVS HEAD,
but I figure it should apply fine on 7.16.0 as well...

diff -u -r1.327 transfer.c
--- lib/transfer.c 21 Dec 2006 10:18:15 -0000 1.327
+++ lib/transfer.c 12 Jan 2007 22:39:10 -0000
@@ -347,9 +347,6 @@
          size_t bytestoread = buffersize;
          int readrc;

- if (k->size != -1 && !k->header)
- bytestoread = (size_t)(k->size - k->bytecount);
-
          /* receive data from the network! */
          readrc = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread);

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-01-12