curl-library
Re: Running curl in separate SDL thread
Date: Fri, 14 Aug 2009 12:19:26 +0200
On Fri August 14 2009 11:37:04 Trevor Allen wrote:
> Basically what I am trying to do is to use classData to store the data
> I need between the curl thread to download a file and the member
> variables of the class which aren't in the same thread.
>
> If I place *iData->progressPtr as the PROGRESSDATA variable I get a
> pointer error. If I create a local float variable and pass that in,
> then it works just fine but my member variables (mData and mProgress)
> don't receive the updates since they aren't being used as the data
> sources.
>
> Downloader::writer() is the WRITEFUNCTION and Downloader::progress()
> function is the PROGRESSFUNCTION.
>
> This is for an updater application for a game, so this class would
> handle downloading files as needed.
>
> I hope I provided enough info.
Do not top post means "do not write your reply before the quoted text".
Just few notes:
1) Do not use "using" directive in headers.
2) Initialize class members in order.
3) Next time please attach a minimal example, which can we compile and try
to run. We have not enough time for reverse engineering.
4) Avoid misleading constructions like "else;"
5) You don't create Downloader object at all, or am I wrong?? If that's true,
all the class members are completely useless!!
The working version of your example is attached. Wishing good luck with your
development!
Kamil
- text/x-c++src attachment: trevor.cc