diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-03 14:25:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-09-03 14:25:01 -0400 |
commit | 264aa271a734767a13065bc6e0d15c4d8c602005 (patch) | |
tree | 695a1f5c92dbfaed9f4a3c5802c511b101cc9999 | |
parent | a5610cfa64189db693dbad3efaa973d6720c42fe (diff) | |
download | tor-264aa271a734767a13065bc6e0d15c4d8c602005.tar.gz tor-264aa271a734767a13065bc6e0d15c4d8c602005.zip |
Fix bug 9645: don't forget an md just because we can't save it.
-rw-r--r-- | changes/bug9645a | 5 | ||||
-rw-r--r-- | src/or/microdesc.c | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/changes/bug9645a b/changes/bug9645a new file mode 100644 index 0000000000..2daba65a00 --- /dev/null +++ b/changes/bug9645a @@ -0,0 +1,5 @@ + o Minor bugfixes: + - If we are unable to save a microdescriptor to the journal, do not + drop it from memory and then reattempt downloading it. Fixes bug + 9645; bugfix on 0.2.2.6-alpha. + diff --git a/src/or/microdesc.c b/src/or/microdesc.c index b93bd83af5..8b5581f4af 100644 --- a/src/or/microdesc.c +++ b/src/or/microdesc.c @@ -213,7 +213,6 @@ microdescs_add_list_to_cache(microdesc_cache_t *cache, if (fd < 0) { log_warn(LD_DIR, "Couldn't append to journal in %s: %s", cache->journal_fname, strerror(errno)); - return NULL; } } @@ -238,11 +237,11 @@ microdescs_add_list_to_cache(microdesc_cache_t *cache, if (size < 0) { /* we already warned in dump_microdescriptor */ abort_writing_to_file(open_file); - smartlist_clear(added); - return added; + fd = -1; + } else { + md->saved_location = SAVED_IN_JOURNAL; + cache->journal_len += size; } - md->saved_location = SAVED_IN_JOURNAL; - cache->journal_len += size; } else { md->saved_location = where; } |