diff options
author | Taylor Yu <catalyst@torproject.org> | 2017-09-13 16:44:19 -0500 |
---|---|---|
committer | Taylor Yu <catalyst@torproject.org> | 2017-09-14 08:25:27 -0500 |
commit | c0195ccb79a950313801663a1f9d9706ed9aebce (patch) | |
tree | 7359bdd03ead60a0687b90cc6576efa1cd864604 /src/or/networkstatus.c | |
parent | 449bb2351eadd8d01fe89f8d46b4706d50b661b2 (diff) | |
download | tor-c0195ccb79a950313801663a1f9d9706ed9aebce.tar.gz tor-c0195ccb79a950313801663a1f9d9706ed9aebce.zip |
Refactor clock skew handling in networkstatus.c
Move the consensus clock skew handling in
networkstatus_set_current_consensus() to clock_skew_warning().
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 8b07a88853..7953af1cc7 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1989,14 +1989,16 @@ networkstatus_set_current_consensus(const char *consensus, char tbuf[ISO_TIME_LEN+1]; char dbuf[64]; long delta = now - c->valid_after; + char *flavormsg = NULL; format_iso_time(tbuf, c->valid_after); format_time_interval(dbuf, sizeof(dbuf), delta); log_warn(LD_GENERAL, "Our clock is %s behind the time published in the " "consensus network status document (%s UTC). Tor needs an " "accurate clock to work correctly. Please check your time and " "date settings!", dbuf, tbuf); - control_event_general_status(LOG_WARN, - "CLOCK_SKEW MIN_SKEW=%ld SOURCE=CONSENSUS", delta); + tor_asprintf(&flavormsg, "%s flavor consensus", flavor); + clock_skew_warning(NULL, delta, 1, LD_GENERAL, flavormsg, "CONSENSUS"); + tor_free(flavormsg); } router_dir_info_changed(); |