Merge remote-tracking branch 'tor-github/pr/892' into maint-0.4.0

This commit is contained in:
teor 2019-04-09 11:35:41 +10:00
commit 92e8bdf296
No known key found for this signature in database
GPG Key ID: 10FEAA0E7075672A
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,6 @@
o Minor bugfixes (logging):
- On Windows, when errors cause us to reload a consensus from disk, tell
the user that we are retrying at log level "notice". Previously we only
logged this information at "info", which was confusing because the
errors themselves were logged at "warning". Improves previous fix for
28614. Fixes bug 30004; bugfix on 0.4.0.2-alpha.

View File

@ -1761,8 +1761,11 @@ reload_consensus_from_file(const char *fname,
flavor, flags, source_dir); flavor, flags, source_dir);
#ifdef _WIN32 #ifdef _WIN32
if (rv < 0 && tor_memstr(map->data, map->size, "\r\n")) { if (rv < 0 && tor_memstr(map->data, map->size, "\r\n")) {
log_info(LD_GENERAL, "Found CRLF in consensus file %s; falling back to " log_notice(LD_GENERAL, "Looks like the above failures are probably "
"read_file_to_string.", escaped(fname)); "because of a CRLF in consensus file %s; falling back to "
"read_file_to_string. Nothing to worry about: this file "
"was probably saved by an earlier version of Tor.",
escaped(fname));
char *content = read_file_to_str(fname, RFTS_IGNORE_MISSING, NULL); char *content = read_file_to_str(fname, RFTS_IGNORE_MISSING, NULL);
rv = networkstatus_set_current_consensus(content, strlen(content), rv = networkstatus_set_current_consensus(content, strlen(content),
flavor, flags, source_dir); flavor, flags, source_dir);