cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Let the user specify the download buffer

From: Daniel Stenberg <daniel_at_haxx.se>
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
think.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-04-02