Replace last_added_nonpadding with last_had_circuits

The point of the "idle timeout" for connections is to kill the
connection a while after it has no more circuits.  But using "last
added a non-padding cell" as a proxy for that is wrong, since if the
last circuit is closed from the other side of the connection, we
will not have sent anything on that connection since well before the
last circuit closed.

This is part of fixing 6799.

When applied to 0.2.5, it is also a fix for 12023.
This commit is contained in:
Nick Mathewson
2014-05-16 10:32:31 -04:00
parent 463f6628d3
commit 6557e61295
8 changed files with 50 additions and 32 deletions
+11 -4
View File
@@ -1,13 +1,20 @@
o Major features:
- Increate the base amount of time that a canonical connection
- Increase the base amount of time that a canonical connection
(one that we have made to a known OR) is allowed to stay open
from a 3 minutes to 15 minutes. This leaks less information
about when circuits have closed, and avoids unnecessary overhead
from renegotiating connections. Part of a fix for ticket 6799.
- Instead of closing connections at a fixed interval after their
last circuit closed, randomly add up to 50% to each connection's
maximum timout. This makes it harder to tell when the last
- Instead of closing connections after they have been idle for a
fixed interval, randomly add up to 50% to each connection's
maximum timeout. This makes it harder to tell when the last
circuit closed by looking at when a connection closes. Part of a
fix for ticket 6799.
- Base connection idleness tests on the actual time elapsed since
the connection last had circuits, not on the time when we last
added non-padding. This also makes it harder to tell when the last
circuit closed by looking at when a connection closes. Part of a
fix for ticket 6799.
Incidentally fixes bug 12023; bugfix on 0.2.5.1-alpha.