cURL / Mailing Lists / curl-library / Single Mail


Re: how to set maximum bytes to read by CURLOPT_READFUNCTION

From: Daniel Stenberg <>
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

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.

List admin:
Received on 2014-01-19