mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Merge branch 'bug24086_031' into maint-0.3.1
This commit is contained in:
commit
f7b41bcdf0
7
changes/bug24086
Normal file
7
changes/bug24086
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
o Minor bugfixes (directory cache):
|
||||||
|
- When a consensus diff calculation is only partially successful, only
|
||||||
|
record the successful parts as having succeeded. Partial success
|
||||||
|
can happen if (for example) one compression method fails but
|
||||||
|
the others succeed. Previously we misrecorded all the calculations as
|
||||||
|
having succeeded, which would later cause a nonfatal assertion failure.
|
||||||
|
Fixes bug 24086; bugfix on 0.3.1.1-alpha.
|
@ -283,6 +283,10 @@ cdm_diff_ht_set_status(consensus_flavor_t flav,
|
|||||||
int status,
|
int status,
|
||||||
consensus_cache_entry_handle_t *handle)
|
consensus_cache_entry_handle_t *handle)
|
||||||
{
|
{
|
||||||
|
if (handle == NULL) {
|
||||||
|
tor_assert_nonfatal(status != CDM_DIFF_PRESENT);
|
||||||
|
}
|
||||||
|
|
||||||
struct cdm_diff_t search, *ent;
|
struct cdm_diff_t search, *ent;
|
||||||
memset(&search, 0, sizeof(cdm_diff_t));
|
memset(&search, 0, sizeof(cdm_diff_t));
|
||||||
search.flavor = flav;
|
search.flavor = flav;
|
||||||
@ -1589,8 +1593,13 @@ consensus_diff_worker_replyfn(void *work_)
|
|||||||
for (u = 0; u < ARRAY_LENGTH(handles); ++u) {
|
for (u = 0; u < ARRAY_LENGTH(handles); ++u) {
|
||||||
compress_method_t method = compress_diffs_with[u];
|
compress_method_t method = compress_diffs_with[u];
|
||||||
if (cache) {
|
if (cache) {
|
||||||
cdm_diff_ht_set_status(flav, from_sha3, to_sha3, method, status,
|
consensus_cache_entry_handle_t *h = handles[u];
|
||||||
handles[u]);
|
int this_status = status;
|
||||||
|
if (h == NULL) {
|
||||||
|
this_status = CDM_DIFF_ERROR;
|
||||||
|
}
|
||||||
|
tor_assert_nonfatal(h != NULL || this_status == CDM_DIFF_ERROR);
|
||||||
|
cdm_diff_ht_set_status(flav, from_sha3, to_sha3, method, this_status, h);
|
||||||
} else {
|
} else {
|
||||||
consensus_cache_entry_handle_free(handles[u]);
|
consensus_cache_entry_handle_free(handles[u]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user