mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix super-mirror issue
This commit is contained in:
parent
8d3b22e3cc
commit
8bcb52efdd
@ -349,11 +349,20 @@ class AppRunner(DirectObject):
|
|||||||
assert self.http
|
assert self.http
|
||||||
|
|
||||||
# It's stale, get a new one.
|
# It's stale, get a new one.
|
||||||
url = PandaModules.URLSpec(host.hostUrlPrefix + fileSpec.filename)
|
doc = None
|
||||||
print "Freshening %s" % (url)
|
if self.superMirrorUrl:
|
||||||
doc = self.http.getDocument(url)
|
# Use the "super mirror" first.
|
||||||
if not doc.isValid():
|
url = PandaModules.URLSpec(self.superMirrorUrl + fileSpec.filename)
|
||||||
return False
|
print "Freshening %s" % (url)
|
||||||
|
doc = self.http.getDocument(url)
|
||||||
|
|
||||||
|
if not doc or not doc.isValid():
|
||||||
|
# Failing the super mirror, contact the actual host.
|
||||||
|
url = PandaModules.URLSpec(host.hostUrlPrefix + fileSpec.filename)
|
||||||
|
print "Freshening %s" % (url)
|
||||||
|
doc = self.http.getDocument(url)
|
||||||
|
if not doc.isValid():
|
||||||
|
return False
|
||||||
|
|
||||||
file = Filename.temporary('', 'p3d_')
|
file = Filename.temporary('', 'p3d_')
|
||||||
if not doc.downloadToFile(file):
|
if not doc.downloadToFile(file):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user