ultimatepp/uppdev/ErrorThread20070606/threads.h
cxl 351994a6cc Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

32 lines
807 B
C

#ifndef _ErrorThread_threads_h_
#define _ErrorThread_threads_h_
struct CallerInfo {
App *app;
};
void DownloadThread(CallerInfo caller)
{
caller.app->isProgressCanceled = false;
String result;
result << "Download started, timeout is set to 30 seconds...";
caller.app->downloadResult.Set(result);
caller.app->tab.RefreshFrame();
HttpClient http;
http.TimeoutMsecs(30000);
http.URL("http://www.ccl.net/cca/software/UNIX/apache/httpd.conf.3.1b1.txt");
result = http.Execute(callback(caller.app, &App::ProgressCanceled));
if (!caller.app->isProgressCanceled) {
if(result.IsEmpty()) {
result << "Error: Connection timeout!";
}
caller.app->downloadResult.Set(result);
caller.app->tab.RefreshFrame();
}
caller.app->ActionDownloadStop(false);
}
#endif