cURL / Mailing Lists / curl-library / Single Mail


Slight bug in the c/c++ API (or maybe just docs)

From: Ben Greear <>
Date: Fri, 07 Dec 2001 17:48:36 -0700

The CURLOPT_READFUNCTION documentation talks about returning a -1 on error, but
size_t is unsigned (at least on RH 7.2 Linux)

Maybe you want ssize_t arguments??

Function pointer that should match the following
              prototype: size_t function( void *ptr, size_t size,
size_t nmemb, void *stream); This function gets
              called by libcurl as soon as it needs to read data
              in order to send it to the peer. The data area
              pointed at by the pointer ptr may be filled with at
              most size multiplied with nmemb number of bytes.
              Your function must return the actual number of bytes
              that you stored in that memory area. Returning -1
              will signal an error to the library and cause it to
              abort the current transfer immediately (with a
              CURLE_READ_ERROR return code).

Ben Greear <>       <Ben_Greear AT>
President of Candela Technologies Inc
Received on 2001-12-08