From b2d1bfa624371d4cf09563b09c9d47a8e96a6584 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 3 Dec 2009 23:24:29 +0000 Subject: [PATCH] fail over from bogus mirror more gracefully --- direct/src/p3d/PackageInfo.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/direct/src/p3d/PackageInfo.py b/direct/src/p3d/PackageInfo.py index daa82813c8..6fc422bae9 100644 --- a/direct/src/p3d/PackageInfo.py +++ b/direct/src/p3d/PackageInfo.py @@ -688,19 +688,26 @@ class PackageInfo: elif not fileSpec.fullVerify(self.getPackageDir(), pathname = targetPathname): print "After downloading, %s incorrect" % (Filename(fileSpec.filename).getBasename()) + + # This attempt failed. Maybe the original contents.xml + # file is stale. Try re-downloading it now, just to be + # sure. + if self.host.redownloadContentsFile(self.http): + # Yes! Go back and start over from the beginning. + return self.restartDownload + else: # Success! return self.stepComplete - # This attempt failed. Maybe the original contents.xml - # file is stale. Try re-downloading it now, just to be - # sure. - if self.host.redownloadContentsFile(self.http): - # Yes! Go back and start over from the beginning. - return self.restartDownload + # Maybe the mirror is bad. Go back and try the next + # mirror. - # Well, that wasn't the problem. Maybe the mirror is bad. - # Go back and try the next mirror. + # All attempts failed. Maybe the original contents.xml file + # is stale. Try re-downloading it now, just to be sure. + if self.host.redownloadContentsFile(self.http): + # Yes! Go back and start over from the beginning. + return self.restartDownload # All mirrors failed; the server (or the internet connection) # must be just fubar.