diff options
author | Taylor Yu <catalyst@torproject.org> | 2018-08-28 14:52:44 -0500 |
---|---|---|
committer | Taylor Yu <catalyst@torproject.org> | 2018-09-10 13:18:32 -0500 |
commit | 5733d3f71f0094c2eade64795521321cd653855b (patch) | |
tree | 7e1e7d52e9cfbb13f60c309ba436ac09146f4953 /src/feature | |
parent | 15c24d669f86715c3c24d1a50b377bd8ac65b0a7 (diff) | |
download | tor-5733d3f71f0094c2eade64795521321cd653855b.tar.gz tor-5733d3f71f0094c2eade64795521321cd653855b.zip |
Refactor control_event_bootstrap_core() more
Eliminate a few conditional expressions in
control_event_bootstrap_core() by overwriting the status parameter.
Diffstat (limited to 'src/feature')
-rw-r--r-- | src/feature/control/control.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/feature/control/control.c b/src/feature/control/control.c index 4395cbd2c9..64785a758d 100644 --- a/src/feature/control/control.c +++ b/src/feature/control/control.c @@ -7106,12 +7106,15 @@ control_event_bootstrap_core(int loglevel, bootstrap_status_t status, const char *tag, *summary; bootstrap_status_to_string(status, &tag, &summary); + /* Locally reset status if there's incremental progress */ + if (progress) + status = progress; tor_log(loglevel, LD_CONTROL, - "Bootstrapped %d%%: %s", progress ? progress : status, summary); + "Bootstrapped %d%%: %s", status, summary); tor_snprintf(buf, sizeof(buf), "BOOTSTRAP PROGRESS=%d TAG=%s SUMMARY=\"%s\"", - progress ? progress : status, tag, summary); + status, tag, summary); tor_snprintf(last_sent_bootstrap_message, sizeof(last_sent_bootstrap_message), "NOTICE %s", buf); |