cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: 7.16.0 regression with large files

From: Matt Witherspoon <spoon_at_vt.edu>
Date: Thu, 11 Jan 2007 14:25:59 -0500

Quoting Daniel Stenberg <daniel_at_haxx.se>:

> Check again. That fourth argument to Curl_read() is the largest amount of
> data
> that is allowed to be read in that call into the given buffer. Since the
> buffer we use is 16K, 'sizerequested' should never be larger than that...

Nope, I think this was changed/broken with the HTTP pipelining stuff. Take a
look at transfer.c:322, bytestoread is always set to size-bytecount and then
cast to a size_t. So the 4th argument to Curl_read() is the expected size
"left" in the transfer. I just confirmed this by doing a
fprintf(stderr, "sizereq:%u\n", sizerequested);
and I see:
sizereq:24629248
sizereq:24612864
sizereq:24596480
sizereq:24580096
sizereq:24563712
etc.

It would seem that with a 4GB+ size file, this would be a problem.
size-bytecount will wrap around, thus making sizerequested be 4GB smaller than
the real filesize.

-Matt
Received on 2007-01-11