cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: passing state in write callbacks

From: Alex Loukissas <alex_at_maginatics.com>
Date: Thu, 15 Sep 2011 14:31:19 -0700

On Thu, Sep 15, 2011 at 2:23 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Thu, 15 Sep 2011, Alex Loukissas wrote:
>
>>> Why can't you just use the existing void * argument?
>>
>> Correct me if I'm wrong, but doesn't this contain the data read by curl to
>> be written to the file? At least this is what's passed onto fwrite( ).
>
> http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTWRITEFUNCTION
>
> And the quote from the above link:
>
>  "Set the userdata argument with the CURLOPT_WRITEDATA option"
>
> IOW: no, you set that pointer yourself to whatever you want. It is only if
> you don't use the callback it should be a FILE *.

Actually, that's all true. I missed that part, was treating the second
void* as FILE* all along without noticing it was more generic than
this. You can mark this thread as closed.

>
> --
>
>  / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-15