cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how to set maximum bytes to read by CURLOPT_READFUNCTION

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 19 Jan 2014 00:20:32 +0100 (CET)

On Sat, 18 Jan 2014, Sergey Naumov wrote:

> I'm using libcurl 7.25.0 and want to ask how to set maximum bytes to read by
> CURLOPT_READFUNCTION.

You don't. libcurl has a buffer and you get the size of that to fill.

> I thought that it is done by CURLFORM_CONTENTSLENGTH argument to
> curl_formadd, and then callback function will be called with such size_t
> size, size_t nmemb parameters, that it will not read more than
> CURLFORM_CONTENTSLENGTH bytes, but it looks like size * nmemb only
> represents a buffer size:

You're supposed to return 0 at the end of file.

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