Revision: 1494
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1494&view=rev
Author: rorthomas
Date: 2010-07-24 17:11:12 +0000 (Sat, 24 Jul 2010)
Log Message:
-----------
fixed serious bug in installer: did not retry downloading files after error
Modified Paths:
--------------
trunk/source/installer/threadpool.cpp
trunk/source/installer/threadpool.h
Modified: trunk/source/installer/threadpool.cpp
===================================================================
--- trunk/source/installer/threadpool.cpp 2010-07-22 23:56:25 UTC (rev
1493)
+++ trunk/source/installer/threadpool.cpp 2010-07-24 17:11:12 UTC (rev
1494)
@@ -120,7 +120,7 @@
updateCallback(jobID, MSE_DOWNLOAD_START);
std::string url = dir_use + remoteFile;
int stat = wsdl->downloadFile(jobID, localFile, server_use, url);
- if(stat == -404 && retrycount < 2)
+ if(stat != 0 && retrycount < retrylimit)
{
LOG("DLFile-%04d| result: %d, retrycount: %d, falling back to
main server\n", jobID, stat, retrycount);
// fallback to main server (for this single file only!)
@@ -144,7 +144,7 @@
{
LOG("DLFile-%04d| file hash wrong, is: '%s', should be:
'%s'\n", jobID, checkHash.c_str(), hashRemote.c_str());
WsyncDownload::tryRemoveFile(localFile);
- if(retrycount < 2)
+ if(retrycount < retrylimit)
{
// fallback to main server!
//printf(" hash wrong, falling back to main
server.\n");
@@ -156,7 +156,7 @@
}
}
}
- if(retrycount >= 2)
+ if(retrycount >= retrylimit)
{
updateCallback(jobID, MSE_ERROR, "failed to download file: " +
remoteFile + "\nPlease ensure that you have internet access.");
wxMessageBox(_T("failed to download file: ") + conv(remoteFile)
+ wxT("\nPlease ensure that you have internet access."), _T("Error"),
wxICON_ERROR | wxOK);
Modified: trunk/source/installer/threadpool.h
===================================================================
--- trunk/source/installer/threadpool.h 2010-07-22 23:56:25 UTC (rev 1493)
+++ trunk/source/installer/threadpool.h 2010-07-24 17:11:12 UTC (rev 1494)
@@ -73,6 +73,7 @@
private:
wxEvtHandler *m_handler;
ThreadQueue* m_pQueue;
+ static const int retrylimit = 5;
int m_ID;
virtual wxThread::ExitCode Entry();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel