diff options
author | Roger Dingledine <arma@torproject.org> | 2005-03-19 23:58:42 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-03-19 23:58:42 +0000 |
commit | 4a497e503077826228df667083548d06bf8afc2f (patch) | |
tree | b9afc12290390ca539fd91c78dc54c1fed33c39a /src/or/circuitlist.c | |
parent | 856ab90ca8cf6ace5528396049d53e302d1a3ebe (diff) | |
download | tor-4a497e503077826228df667083548d06bf8afc2f.tar.gz tor-4a497e503077826228df667083548d06bf8afc2f.zip |
if our clock jumps forward by 100 seconds or more, assume something
has gone wrong with our network and abandon all not-yet-used circs.
svn:r3792
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 6f812cb6b1..2c5c300e3e 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -359,6 +359,19 @@ circuit_get_clean_open(uint8_t purpose, int need_uptime, return best; } +/** Go through the circuitlist; mark-for-close each circuit that starts + * at us but has not yet been used. */ +void circuit_mark_all_unused_circs(void) { + circuit_t *circ; + + for (circ=global_circuitlist; circ; circ = circ->next) { + if (CIRCUIT_IS_ORIGIN(circ) && + !circ->marked_for_close && + !circ->timestamp_dirty) + circuit_mark_for_close(circ); + } +} + /** Mark <b>circ</b> to be closed next time we call * circuit_close_all_marked(). Do any cleanup needed: * - If state is onionskin_pending, remove circ from the onion_pending |