diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-08 11:20:26 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-09 10:28:59 -0500 |
commit | 69df16e3765383bd59fd2fbedbb5301f3b58ab14 (patch) | |
tree | ca11ab5d577a9f3c3ceccd9917a95c8d115468f8 /src/common/container.h | |
parent | 33df3e37ffecfed309a1a0f210a96620c0ebb837 (diff) | |
download | tor-69df16e3765383bd59fd2fbedbb5301f3b58ab14.tar.gz tor-69df16e3765383bd59fd2fbedbb5301f3b58ab14.zip |
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.
Diffstat (limited to 'src/common/container.h')
-rw-r--r-- | src/common/container.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 @@ -243,6 +243,17 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join, STMT_END /** Helper: While in a SMARTLIST_FOREACH loop over the list <b>sl</b> indexed + * with the variable <b>var</b>, 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 <b>sl</b> indexed * with the variable <b>var</b>, replace the current element with <b>val</b>. * Does not deallocate the current value of <b>var</b>. */ |