diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-06-23 10:49:03 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-28 19:15:08 -0400 |
commit | 26146dbe9eb2404274b7c51121710f3f3529c930 (patch) | |
tree | 86cc5b191e87c4d45a57063ced8598af5d9c02c1 /scripts | |
parent | dae442a38272f26a2c0580a6ec03fec392c4ac9d (diff) | |
download | tor-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-x | scripts/maint/updateFallbackDirs.py | 9 |
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 += '/*' |