From 69df16e3765383bd59fd2fbedbb5301f3b58ab14 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 8 Jan 2015 11:20:26 -0500 Subject: Rewrite the logic for deciding when to drop old/superseded certificates Fixes bug 11454, where we would keep around a superseded descriptor if the descriptor replacing it wasn't at least a week later. Bugfix on 0.2.1.8-alpha. Fixes bug 11457, where a certificate with a publication time in the future could make us discard existing (and subsequent!) certificates with correct publication times. Bugfix on 0.2.0.3-alpha. --- src/common/container.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common/container.h') diff --git a/src/common/container.h b/src/common/container.h index 377cdf5dba..c704833da9 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -242,6 +242,17 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join, --var ## _sl_len; \ STMT_END +/** Helper: While in a SMARTLIST_FOREACH loop over the list sl indexed + * with the variable var, remove the current element in a way that + * won't confuse the loop. */ +#define SMARTLIST_DEL_CURRENT_KEEPORDER(sl, var) \ + STMT_BEGIN \ + smartlist_del_keeporder(sl, var ## _sl_idx); \ + --var ## _sl_idx; \ + --var ## _sl_len; \ + STMT_END + + /** Helper: While in a SMARTLIST_FOREACH loop over the list sl indexed * with the variable var, replace the current element with val. * Does not deallocate the current value of var. -- cgit v1.2.3-54-g00ecf