aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-10-05 22:31:21 +0000
committerRoger Dingledine <arma@torproject.org>2005-10-05 22:31:21 +0000
commitc3aac3ff6bb5d3a2bcacd82f27d6dfaf55cc1bef (patch)
treef1f3bda8157b9bcd802852fb7cceb5dec145487d /src/or/circuitlist.c
parent92abf1b6530484afb9c01f54c2d341a47cb8d386 (diff)
downloadtor-c3aac3ff6bb5d3a2bcacd82f27d6dfaf55cc1bef.tar.gz
tor-c3aac3ff6bb5d3a2bcacd82f27d6dfaf55cc1bef.zip
infrastructure for the 'change pseudonym' button.
not used yet. svn:r5199
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 51dc4c7140..7e50762963 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -567,6 +567,27 @@ circuit_mark_all_unused_circs(void)
}
}
+/** Go through the circuitlist; for each circuit that starts at us
+ * and is dirty, frob its timestamp_dirty so we won't use it for any
+ * new streams.
+ *
+ * This is useful for letting the user change pseudonyms, so new
+ * streams will not be linkable to old streams.
+ */
+void
+circuit_expire_all_dirty_circs(void)
+{
+ circuit_t *circ;
+ or_options_t *options = get_options();
+
+ for (circ=global_circuitlist; circ; circ = circ->next) {
+ if (CIRCUIT_IS_ORIGIN(circ) &&
+ !circ->marked_for_close &&
+ circ->timestamp_dirty)
+ circ->timestamp_dirty -= options->MaxCircuitDirtiness;
+ }
+}
+
/** 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