|
@@ -1127,14 +1127,15 @@ class Candidate(object):
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
- def fallback_consensus_download_speed(dirip, dirport, nickname, max_time):
|
|
|
+ def fallback_consensus_download_speed(dirip, dirport, nickname, fingerprint,
|
|
|
+ max_time):
|
|
|
download_failed = False
|
|
|
start = datetime.datetime.utcnow()
|
|
|
|
|
|
|
|
|
- logging.info('Initiating %sconsensus download from %s (%s:%d).',
|
|
|
+ logging.info('Initiating %sconsensus download from %s (%s:%d) %s.',
|
|
|
'microdesc ' if DOWNLOAD_MICRODESC_CONSENSUS else '',
|
|
|
- nickname, dirip, dirport)
|
|
|
+ nickname, dirip, dirport, fingerprint)
|
|
|
|
|
|
|
|
|
TIMEOUT_SLOP = 1.0
|
|
@@ -1171,9 +1172,9 @@ class Candidate(object):
|
|
|
else:
|
|
|
status = 'ok'
|
|
|
level = logging.DEBUG
|
|
|
- logging.log(level, 'Consensus download: %0.1fs %s from %s (%s:%d), ' +
|
|
|
+ logging.log(level, 'Consensus download: %0.1fs %s from %s (%s:%d) %s, ' +
|
|
|
'max download time %0.1fs.', elapsed, status, nickname,
|
|
|
- dirip, dirport, max_time)
|
|
|
+ dirip, dirport, fingerprint, max_time)
|
|
|
return download_failed
|
|
|
|
|
|
|
|
@@ -1185,12 +1186,14 @@ class Candidate(object):
|
|
|
ipv4_failed = Candidate.fallback_consensus_download_speed(self.dirip,
|
|
|
self.dirport,
|
|
|
self._data['nickname'],
|
|
|
+ self._fpr,
|
|
|
CONSENSUS_DOWNLOAD_SPEED_MAX)
|
|
|
if self.has_ipv6() and PERFORM_IPV6_DIRPORT_CHECKS:
|
|
|
|
|
|
ipv6_failed = Candidate.fallback_consensus_download_speed(self.ipv6addr,
|
|
|
self.dirport,
|
|
|
self._data['nickname'],
|
|
|
+ self._fpr,
|
|
|
CONSENSUS_DOWNLOAD_SPEED_MAX)
|
|
|
return ((not ipv4_failed) and (not ipv6_failed))
|
|
|
|