diff options
author | Andrea Shepard <andrea@torproject.org> | 2013-07-16 06:01:50 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2013-07-16 06:01:50 -0700 |
commit | 9b3a166b44267fb93ab4f2f406bfd1a308118ea6 (patch) | |
tree | 20d135e6d775035787aa5561f58e18101a2e2e60 /src/or/replaycache.c | |
parent | d1059a936644f1a3c274f97218c7224622f212df (diff) | |
download | tor-9b3a166b44267fb93ab4f2f406bfd1a308118ea6.tar.gz tor-9b3a166b44267fb93ab4f2f406bfd1a308118ea6.zip |
Eliminate an impossible case in replaycache_scrub_if_needed_internal()
Diffstat (limited to 'src/or/replaycache.c')
-rw-r--r-- | src/or/replaycache.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/or/replaycache.c b/src/or/replaycache.c index f136072f61..122efb7030 100644 --- a/src/or/replaycache.c +++ b/src/or/replaycache.c @@ -134,7 +134,6 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r) const char *digest; void *valp; time_t *access_time; - char scrub_this; /* sanity check */ if (!r || !(r->digests_seen)) { @@ -152,20 +151,10 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r) /* okay, scrub time */ itr = digestmap_iter_init(r->digests_seen); while (!digestmap_iter_done(itr)) { - scrub_this = 0; digestmap_iter_get(itr, &digest, &valp); access_time = (time_t *)valp; - if (access_time) { - /* aged out yet? */ - if (*access_time < present - r->horizon) scrub_this = 1; - } else { - /* Buh? Get rid of it, anyway */ - log_info(LD_BUG, "replaycache_scrub_if_needed_internal() saw a NULL" - " entry in the digestmap."); - scrub_this = 1; - } - - if (scrub_this) { + /* aged out yet? */ + if (*access_time < present - r->horizon) { /* Advance the iterator and remove this one */ itr = digestmap_iter_next_rmv(r->digests_seen, itr); /* Free the value removed */ |