mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Merge branch 'maint-0.3.1'
This commit is contained in:
commit
2c718c1a12
4
changes/diagnose_22752
Normal file
4
changes/diagnose_22752
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor features (bug mitigation, diagnostics, logging):
|
||||
- Avoid an assertion failure, and log a better error message,
|
||||
when unable to remove a file from the consensus cache on
|
||||
Windows. Attempts to mitigate and diagnose bug 22752.
|
@ -119,7 +119,8 @@ storage_dir_clean_tmpfiles(storage_dir_t *d)
|
||||
char *path = NULL;
|
||||
tor_asprintf(&path, "%s/%s", d->directory, fname);
|
||||
if (unlink(sandbox_intern_string(path))) {
|
||||
log_warn(LD_FS, "Unable to unlink %s", escaped(path));
|
||||
log_warn(LD_FS, "Unable to unlink %s while cleaning "
|
||||
"temporary files: %s", escaped(path), strerror(errno));
|
||||
tor_free(path);
|
||||
continue;
|
||||
}
|
||||
@ -455,7 +456,8 @@ storage_dir_remove_file(storage_dir_t *d,
|
||||
if (unlink(ipath) == 0) {
|
||||
storage_dir_reduce_usage(d, size);
|
||||
} else {
|
||||
log_warn(LD_FS, "Unable to unlink %s", escaped(path));
|
||||
log_warn(LD_FS, "Unable to unlink %s while removing file: %s",
|
||||
escaped(path), strerror(errno));
|
||||
tor_free(path);
|
||||
return;
|
||||
}
|
||||
|
@ -325,7 +325,8 @@ cdm_diff_ht_purge(consensus_flavor_t flav,
|
||||
if ((*diff)->cdm_diff_status == CDM_DIFF_PRESENT &&
|
||||
flav == (*diff)->flavor) {
|
||||
|
||||
if (consensus_cache_entry_handle_get((*diff)->entry) == NULL) {
|
||||
if (BUG((*diff)->entry == NULL) ||
|
||||
consensus_cache_entry_handle_get((*diff)->entry) == NULL) {
|
||||
/* the underlying entry has gone away; drop this. */
|
||||
next = HT_NEXT_RMV(cdm_diff_ht, &cdm_diff_ht, diff);
|
||||
cdm_diff_free(this);
|
||||
@ -622,6 +623,9 @@ consdiffmgr_find_diff_from(consensus_cache_entry_t **entry_out,
|
||||
return CONSDIFF_IN_PROGRESS;
|
||||
}
|
||||
|
||||
if (BUG(ent->entry == NULL)) {
|
||||
return CONSDIFF_NOT_FOUND;
|
||||
}
|
||||
*entry_out = consensus_cache_entry_handle_get(ent->entry);
|
||||
return (*entry_out) ? CONSDIFF_AVAILABLE : CONSDIFF_NOT_FOUND;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user