cURL / Mailing Lists / curl-library / Single Mail


Re: Let the user specify the download buffer

From: Daniel Stenberg <>
Date: Wed, 2 Apr 2014 10:14:58 +0200 (CEST)

On Tue, 1 Apr 2014, Rich Gray wrote:

> Seems to me that one way to go about more flexible buffering would be to
> make new versions of the read and write callback routines. If they were
> passed a struct containing at least the buffer address and count, then the
> callback could manipulate the buffers as desired for the next operation.

That sounds like a rather simple and yet elegant solution - I like it. Just
make sure that libcurl has a buffer for the first callback time, then deliver
back a new buffer+size for every time libcurl delivers data.

There would have to be a minimum size for that buffer that you'd give libcurl
and you shouldn't assume that libcurl will actually fill it all up before it
calls the callback with data but yeah, that would be a rather good way I

List admin:
Received on 2014-04-02