aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control/control.c
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2018-08-28 13:30:58 -0500
committerTaylor Yu <catalyst@torproject.org>2018-09-10 13:18:32 -0500
commiteee62e13d97e3f07c0d8577f34729f4192738b44 (patch)
treef51df51cf47e9dcd9b73614f7da862caeb6e4763 /src/feature/control/control.c
parentb87a95289b63c891f4e12e0d40f41a39dae5aa7e (diff)
downloadtor-eee62e13d97e3f07c0d8577f34729f4192738b44.tar.gz
tor-eee62e13d97e3f07c0d8577f34729f4192738b44.zip
Make control_event_bootstrap() return void
Simplify control_event_bootstrap() by making it return void again. It is currently a fairly complicated function, and it's made more complicated by returning an int to signal whether it logged at NOTICE or INFO. The callers conditionally log messages at level NOTICE based on this return value. Change the callers to unconditionally log their verbose human-readable messages at level INFO to keep NOTICE logs less cluttered. This partially reverts the changes of #14950.
Diffstat (limited to 'src/feature/control/control.c')
-rw-r--r--src/feature/control/control.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index 9e7d21308e..84ff7d71db 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -7101,17 +7101,15 @@ 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.
- *
- * Return true if we logged a message at level NOTICE, and false otherwise.
*/
-int
+void
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 0; /* already bootstrapped; nothing to be done here. */
+ return; /* 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. */
@@ -7158,10 +7156,7 @@ 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