diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-13 09:57:10 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-13 09:57:10 -0400 |
commit | 76e9de7c6d1a22d89053dd4fa8671d5696c52634 (patch) | |
tree | ce47d720487e2aab988921da4cf78f1297d9354b /src/or/router.c | |
parent | 8c8ed91aae24aa1188275dfb6fbd5f6fcbcbe1a8 (diff) | |
parent | 1c80eb92fa6c5240b1029c5ee1febe2d20b7d882 (diff) | |
download | tor-76e9de7c6d1a22d89053dd4fa8671d5696c52634.tar.gz tor-76e9de7c6d1a22d89053dd4fa8671d5696c52634.zip |
Merge branch 'maint-0.3.3'
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index ea65977882..3879863e82 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1931,7 +1931,7 @@ static routerinfo_t *desc_routerinfo = NULL; static extrainfo_t *desc_extrainfo = NULL; /** Why did we most recently decide to regenerate our descriptor? Used to * tell the authorities why we're sending it to them. */ -static const char *desc_gen_reason = NULL; +static const char *desc_gen_reason = "uninitialized reason"; /** Since when has our descriptor been "clean"? 0 if we need to regenerate it * now. */ static time_t desc_clean_since = 0; @@ -2555,6 +2555,9 @@ router_rebuild_descriptor(int force) desc_clean_since = time(NULL); desc_needs_upload = 1; desc_gen_reason = desc_dirty_reason; + if (BUG(desc_gen_reason == NULL)) { + desc_gen_reason = "descriptor was marked dirty earlier, for no reason."; + } desc_dirty_reason = NULL; control_event_my_descriptor_changed(); return 0; @@ -2611,6 +2614,9 @@ void mark_my_descriptor_dirty(const char *reason) { const or_options_t *options = get_options(); + if (BUG(reason == NULL)) { + reason = "marked descriptor dirty for unspecified reason"; + } if (server_mode(options) && options->PublishServerDescriptor_) log_info(LD_OR, "Decided to publish new relay descriptor: %s", reason); desc_clean_since = 0; |