diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-03-14 10:42:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-14 10:42:49 -0400 |
commit | d01cf18ecbb02bca7e4168b28f28d8b84f03da70 (patch) | |
tree | 8b834125a3b2e09ed8b564181e49f3f5cb939a4c /src/or/networkstatus.c | |
parent | 102bb1c04f5cb4fb3eae7f41f80660e47c64ceb6 (diff) | |
download | tor-d01cf18ecbb02bca7e4168b28f28d8b84f03da70.tar.gz tor-d01cf18ecbb02bca7e4168b28f28d8b84f03da70.zip |
should_disable_dir_fetches() now returns 1 if DisableNetwork==1
This change prevents LD_BUG warnings and bootstrap failure messages
when we try to do directory fetches when starting with
DisableNetwork == 1, a consensus present, but no descriptors (or
insufficient descriptors) yet.
Fixes bug 11200 and bug 10405. It's a bugfix on 0.2.3.9-alpha.
Thanks to mcs for walking me through the repro instructions!
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 49478a7341..1819c4ef71 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -898,6 +898,14 @@ should_delay_dir_fetches(const or_options_t *options, const char **msg_out) *msg_out = NULL; } + if (options->DisableNetwork) { + if (msg_out) { + *msg_out = "DisableNetwork is set."; + } + log_info(LD_DIR, "Delaying dir fetches (DisableNetwork is set)"); + return 1; + } + if (options->UseBridges) { if (!any_bridge_descriptors_known()) { if (msg_out) { |