mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
62fb209d83
In a number of places, we decrement timestamp_dirty by
MaxCircuitDirtiness in order to mark a stream as "unusable for any
new connections.
This pattern sucks for a few reasons:
* It is nonobvious.
* It is error-prone: decrementing 0 can be a bad choice indeed.
* It really wants to have a function.
It can also introduce bugs if the system time jumps backwards, or if
MaxCircuitDirtiness is increased.
So in this patch, I add an unusable_for_new_conns flag to
origin_circuit_t, make it get checked everywhere it should (I looked
for things that tested timestamp_dirty), and add a new function to
frob it.
For now, the new function does still frob timestamp_dirty (after
checking for underflow and whatnot), in case I missed any cases that
should be checking unusable_for_new_conns.
Fixes bug 6174. We first used this pattern in
|
||
---|---|---|
.. | ||
bug1992 | ||
bug2286 | ||
bug6174 | ||
bug7054 | ||
bug7801 | ||
bug7816_023 | ||
bug7816_023_small | ||
bug7816.024 | ||
bug7902 | ||
bug8065 | ||
bug8121 | ||
bug8151 | ||
bug8158 | ||
bug8161 | ||
bug8200 | ||
bug8207 | ||
bug8208 | ||
bug8209 | ||
bug8210 | ||
bug8218 | ||
cov980650 | ||
easy.ratelim | ||
feature4994 | ||
geoip-feb2013 | ||
integers_donna | ||
signof_enum | ||
ticket2267 |