curl-library
Re: Running curl in separate SDL thread
Date: Fri, 14 Aug 2009 02:22:01 -0700
I hope I send this back right. So if I wanted to set the WRITEDATA to
the std::string contained within iData, my best bet would be to use a
wrapper function? I can get it to work by using a local std::string
and float. Unfortunately pointers aren't my strongest skill yet.
Thank you for taking the time to respond.
On Aug 14, 2009, at 2:10 AM, Kamil Dudka wrote:
> On Fri August 14 2009 10:56:10 Trevor Allen wrote:
>> That fixed my URL error, which brings me back to the curl_easy_setopt
>> for PROGRESSDATA and WRITEDATA. Using the iData struct (assuming I
>> still can) what would it be?
>
> Of course you can. The only thing necessary is to respect libcurl API:
> http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
>
> These options expect pointer to a function of specified type. Note
> they
> can't be (non-static) methods, because 'this' pointer is not passed
> to them.
>
> But it's easy to make a "static to non-static" wrapper, because you
> can pass
> user defined pointer to these functions. The pointer (of type void
> *) you can
> cast to pointer of object's type and then call the method using the
> pointer.
>
> Please append curl-library mailing list to CC on reply and do not
> top post.
>
> Kamil
>
Received on 2009-08-14