diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-02-20 02:03:42 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-02-23 13:03:56 -0500 |
commit | d221b507c9b014039a94aa91bed082689342e347 (patch) | |
tree | 32b2d78390aaa9a126dbbe729f11d23db63efaa6 /src/or/control.c | |
parent | 10ae9b9bf5882287ada74bc3e90f65ca64c27fab (diff) | |
download | tor-d221b507c9b014039a94aa91bed082689342e347.tar.gz tor-d221b507c9b014039a94aa91bed082689342e347.zip |
Avoid logging natural-language reports that are redundant with bootstrapping
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c index 064b745c9f..a2b986768a 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -4971,15 +4971,18 @@ static int bootstrap_problems = 0; * * <b>status</b> is the new status, that is, what task we will be doing * next. <b>progress</b> is zero if we just started this task, else it - * represents progress on the task. */ -void + * represents progress on the task. + * + * Return true if we logged a message at level NOTICE, and false otherwise. + */ +int control_event_bootstrap(bootstrap_status_t status, int progress) { const char *tag, *summary; char buf[BOOTSTRAP_MSG_LEN]; if (bootstrap_percent == BOOTSTRAP_STATUS_DONE) - return; /* already bootstrapped; nothing to be done here. */ + return 0; /* already bootstrapped; nothing to be done here. */ /* special case for handshaking status, since our TLS handshaking code * can't distinguish what the connection is going to be for. */ @@ -5026,7 +5029,10 @@ control_event_bootstrap(bootstrap_status_t status, int progress) /* Remember that we gave a notice at this level. */ notice_bootstrap_percent = bootstrap_percent; } + return loglevel == LOG_NOTICE; } + + return 0; } /** Called when Tor has failed to make bootstrapping progress in a way |