summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-06-23 10:49:03 +1000
committerNick Mathewson <nickm@torproject.org>2016-06-28 19:15:08 -0400
commit26146dbe9eb2404274b7c51121710f3f3529c930 (patch)
tree86cc5b191e87c4d45a57063ced8598af5d9c02c1 /scripts
parentdae442a38272f26a2c0580a6ec03fec392c4ac9d (diff)
downloadtor-26146dbe9eb2404274b7c51121710f3f3529c930.tar.gz
tor-26146dbe9eb2404274b7c51121710f3f3529c930.zip
Comment-out fallbacks in a way the stem fallback parser understands
If we manually remove fallbacks in C by adding '/*' and '*/' on separate lines, stem still parses them as being present, because it only looks at the start of a line. Add a comment to this effect in the generated source code.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/maint/updateFallbackDirs.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
index d17e702b6f..110ecda64c 100755
--- a/scripts/maint/updateFallbackDirs.py
+++ b/scripts/maint/updateFallbackDirs.py
@@ -1828,20 +1828,25 @@ class CandidateList(dict):
def summarise_fallbacks(self, eligible_count, operator_count, failed_count,
guard_count, target_count):
+ s = ''
+ s += '/* To comment-out entries in this file, use C comments, and add *'
+ s += ' to the start of each line. (stem finds fallback entries using "'
+ s += ' at the start of a line.) */'
+ s += '\n'
# Report:
# whether we checked consensus download times
# the number of fallback directories (and limits/exclusions, if relevant)
# min & max fallback bandwidths
# #error if below minimum count
if PERFORM_IPV4_DIRPORT_CHECKS or PERFORM_IPV6_DIRPORT_CHECKS:
- s = '/* Checked %s%s%s DirPorts served a consensus within %.1fs. */'%(
+ s += '/* Checked %s%s%s DirPorts served a consensus within %.1fs. */'%(
'IPv4' if PERFORM_IPV4_DIRPORT_CHECKS else '',
' and ' if (PERFORM_IPV4_DIRPORT_CHECKS
and PERFORM_IPV6_DIRPORT_CHECKS) else '',
'IPv6' if PERFORM_IPV6_DIRPORT_CHECKS else '',
CONSENSUS_DOWNLOAD_SPEED_MAX)
else:
- s = '/* Did not check IPv4 or IPv6 DirPort consensus downloads. */'
+ s += '/* Did not check IPv4 or IPv6 DirPort consensus downloads. */'
s += '\n'
# Multiline C comment with #error if things go bad
s += '/*'