cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Size of chunks in chunked uploads

From: Apurva Mehta <apurva_at_mathmeth.com>
Date: Fri, 1 May 2009 11:41:12 -0700

Hi, Thanks for your response.

> There is no particular default size, libcurl will "wrap" whatever the read
> function returns with the chunked transfer magic. And no, there's no way to
> change that other than to simply make your read callback return larger or
> smaller chunks.

I have two questions:

(0) Doesn't the read callback accept as arguments the maximum size it
is allowed to copy into the buffer? How is it then possible to have
the read callback send larger or smaller values (and so control the
chunk size)?

(1) What about the command-line curl utility? I notice that when I use
it to upload large files using chunked encoding, the server receives
128 byte chunks. For the same file uploaded to the same server without
chunked encoding, the server receives the data in 4000 byte segments.
(This is an apache webserver and a I get these numbers because I have
a custom apache module handling these uploads.) This is what lead me
to believe that there is some implicit default value for the chunk
size.

Thanks,
Apurva

On Fri, May 1, 2009 at 11:23 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 1 May 2009, Apurva Mehta wrote:
>
>> Hi, I was wondering if there is any way to specif the chunk size in HTTP
>> uploads with chunked transfer-encoding (ie. with the
>> "Transfer-encoding:chunked" header). It seems that the default chunk size
>> is 128 bytes. I would like to increase this value and was wondering if there
>> is any option I can specify (through libcurl or command line curl) to do
>> this.
>
>
> --
>
> / daniel.haxx.se
>
Received on 2009-05-01