On Tue, Jun 7, 2011 at 6:24 PM, Daniel Stenberg <[email protected]> wrote: > Allow me to quote a little piece of the manual from > > http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTHEADERFUNCTION > > If this option is not set, or if it is set to NULL, but CURLOPT_HEADERDATA > (CURLOPT_WRITEHEADER) is set to anything but NULL, the function used to > accept response data will be used instead. That is, it will be the function > specified with CURLOPT_WRITEFUNCTION > > I would agree that it is a bit unusual and unexpected (and that is due to > historical reasons and nothing else), but it is documented!
Stating CURLOPT_WRITEHEADER should be a FILE* when CURLOPT_HEADERFUNCTION is not set is slightly misleading in such a scenario. I think it would be prudent to mention something about CURLOPT_WRITEFUNCTION being used as a fallback in the CURLOPT_WRITEHEADER doc entry for clarity like is done for CURLOPT_HEADERFUNCTION, so people don't make assumptions about that FILE* statement.. Lars Nilsson ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
