From a2851d303414bbbdff97a02d142275c3e7c71841 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Fri, 20 May 2011 23:30:37 -0400 Subject: [PATCH 1/3] what's up with this trailing whitespace --- src/common/util.c | 2 +- src/or/circuitbuild.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/util.c b/src/common/util.c index 1bb116b212..7ffe0a98cb 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2092,7 +2092,7 @@ read_file_to_str(const char *filename, int flags, struct stat *stat_out) int save_errno = errno; if (errno == ENOENT && (flags & RFTS_IGNORE_MISSING)) severity = LOG_INFO; - log_fn(severity, LD_FS,"Could not open \"%s\": %s ",filename, + log_fn(severity, LD_FS,"Could not open \"%s\": %s",filename, strerror(errno)); errno = save_errno; return NULL; diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 2f86e1fa34..08bfb98815 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1755,7 +1755,7 @@ circuit_handle_first_hop(origin_circuit_t *circ) /* not currently connected in a useful way. */ const char *name = strlen(firsthop->extend_info->nickname) ? firsthop->extend_info->nickname : fmt_addr(&firsthop->extend_info->addr); - log_info(LD_CIRC, "Next router is %s: %s ", + log_info(LD_CIRC, "Next router is %s: %s", safe_str_client(name), msg?msg:"???"); circ->_base.n_hop = extend_info_dup(firsthop->extend_info); From 3ff7925a7027b81cb9f14b0863972b4d4e5b46a4 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Sat, 21 May 2011 19:10:11 +0200 Subject: [PATCH 2/3] Don't recreate descriptor on sighup We used to regenerate our descriptor whenever we'd get a sighup. This was caused by a bug in options_transition_affects_workers() that would return true even if the options were exactly the same. Down the call path we'd call init_keys(), which made us make a new descriptor which the authorities would reject, and the node would subsequently fall out of the consensus. This patch fixes only the first part of this bug: options_transition_affects_workers() behaves correctly now. The second part still wants a fix. --- changes/bug1810 | 6 ++++++ src/or/config.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changes/bug1810 diff --git a/changes/bug1810 b/changes/bug1810 new file mode 100644 index 0000000000..11e561f7cf --- /dev/null +++ b/changes/bug1810 @@ -0,0 +1,6 @@ + o Major bugfixes: + - Don't decide to make a new descriptor when receiving a HUP signal. + This bug has caused a lot of relays to disappear from the consensus + periodically. Fixes the most common case of triggering bug 1810; + bugfix on 0.2.2.7-alpha. + diff --git a/src/or/config.c b/src/or/config.c index 68a6b29f16..36fb991e33 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3809,7 +3809,7 @@ options_transition_affects_workers(or_options_t *old_options, old_options->ORPort != new_options->ORPort || old_options->ServerDNSSearchDomains != new_options->ServerDNSSearchDomains || - old_options->SafeLogging != new_options->SafeLogging || + old_options->_SafeLogging != new_options->_SafeLogging || old_options->ClientOnly != new_options->ClientOnly || public_server_mode(old_options) != public_server_mode(new_options) || !config_lines_eq(old_options->Logs, new_options->Logs) || From 0e8949a8fae721e856eebbb4fe401484e3acf45f Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sat, 21 May 2011 16:12:37 -0400 Subject: [PATCH 3/3] remove some (confusing) dead code --- src/or/router.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/or/router.c b/src/or/router.c index 49a986d64a..0beb960f6d 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -85,7 +85,6 @@ set_onion_key(crypto_pk_env_t *k) tor_mutex_acquire(key_lock); crypto_free_pk_env(onionkey); onionkey = k; - onionkey_set_at = time(NULL); tor_mutex_release(key_lock); mark_my_descriptor_dirty("set onion key"); }