cURL / Mailing Lists / curl-library / Single Mail


Re: question about curl_multi_perform, callbacks, and presenting a pull interface

From: Daniel Stenberg <>
Date: Thu, 23 Aug 2012 20:18:56 +0200 (CEST)

On Thu, 23 Aug 2012, Rich Bramante wrote:

> Question 1: Can a single call to curl_multi_perform result in multiple
> write callbacks?

Yes it can.

> Internally my library wrapper keeps a fixed-buffer of size
> CURL_MAX_WRITE_SIZE of the data provided by curl calling the write callback.
> Assuming a 1-1 perform/callback

That won't work for the above reason.

> Question 3: What is the best way to craft an interface like this using curl?

The best way is to take care of all data you receive. realloc() the buffer or
use multiple ones.

> Can I use curl_easy_pause() after each write callback and then unpause after
> the client drains my internal buffer and my library needs more data from
> curl?

That should be possible but will slow down the transfer without a really good
reason and it might even make your code a bit more complicated.

List admin:
Received on 2012-08-23