Skip to content
Snippets Groups Projects
Commit bbd893d6 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Write consensus files in binary mode

This will help us out on windows now that we mmap files.  Fixes part
of ticket 28614.
parent d9010c5b
No related branches found
No related tags found
No related merge requests found
o Major bugfixes (windows, startup):
- When writing a consensus file to disk, always write in
"binary" mode so that we can safely map it into memory later.
Fixes part bug 28614; bugfix on 0.4.0.1-alpha.
......@@ -1991,7 +1991,7 @@ networkstatus_set_current_consensus(const char *consensus,
waiting->set_at = now;
waiting->dl_failed = 0;
if (!from_cache) {
write_bytes_to_file(unverified_fname, consensus, consensus_len, 0);
write_bytes_to_file(unverified_fname, consensus, consensus_len, 1);
}
if (dl_certs)
authority_certs_fetch_missing(c, now, source_dir);
......@@ -2142,7 +2142,7 @@ networkstatus_set_current_consensus(const char *consensus,
}
if (!from_cache) {
write_bytes_to_file(consensus_fname, consensus, consensus_len, 0);
write_bytes_to_file(consensus_fname, consensus, consensus_len, 1);
}
warn_early_consensus(c, flavor, now);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment