cURL / Mailing Lists / curl-users / Single Mail

curl-users

CURLOPT_HEADERFUNCTION Documentation Issue

From: Achint Mehta <achintmehta_at_yahoo.com>
Date: Wed, 24 Jan 2007 08:25:24 -0800 (PST)

Hi,

I am using the following.

curl Library version : 7.16.0
Platform : Red Hat Linux
Compiler : g++ (GCC) 3.2.3

I have been referring to the online documentation for
CURLOPT_HEADERFUNCTION parameter of curl_easy_setopt
(http://www.curl.haxx.se/libcurl/c/curl_easy_setopt.html).
The documentation states that:
"The callback function must return the number of bytes
actually taken care of, or return -1 to signal error
to the library "

The return type of this function is size_t which is of
type unsigned int (atleast on my system). So would it
be appropriate to return -1 from this function? The
code form where this function is called checks whether
the function returned the same number of bytes that
was given to it instead of checking it against
0xffffffff or -1.

So,
1. Should the documentation be updated to tell that
returning a value other size * nmemb would raise the
error? or,
2. Change the prototype of callback function from
size_t function( void *ptr, size_t size, size_t nmemb,
void *stream); to ssize_t function( void *ptr, ssize_t
size, ssize_t nmemb, void *stream); or,
3. Have I been looking at entrirely wrong
code/documentation the whole time.

Regards,
Achint

 
____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/
Received on 2007-01-24