aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2013-03-27 17:43:27 -0700
committerNick Mathewson <nickm@torproject.org>2013-03-29 12:17:05 -0400
commitd39e6736fe1608028223604f49d5d091ef23bb27 (patch)
treedc69dfd1b14da9c6314ee983083ef016534eec3d /src
parent1d49ba84a82c6dfb8873cf32fdecdf5af0b65c90 (diff)
downloadtor-d39e6736fe1608028223604f49d5d091ef23bb27.tar
tor-d39e6736fe1608028223604f49d5d091ef23bb27.tar.gz
Don't relax the timeout for already opened 1-hop circuits.
Diffstat (limited to 'src')
-rw-r--r--src/or/circuituse.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index bbf219a1e..8fb70f585 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -529,7 +529,12 @@ circuit_expire_building(void)
if (timercmp(&victim->timestamp_began, &cutoff, >))
continue; /* it's still young, leave it alone */
- if (!any_opened_circs) {
+ /* We need to double-check the opened state here because
+ * we don't want to consider opened 1-hop dircon circuits for
+ * deciding when to relax the timeout, but we *do* want to relax
+ * those circuits too if nothing else is opened *and* they still
+ * aren't either. */
+ if (!any_opened_circs && victim->state != CIRCUIT_STATE_OPEN) {
/* It's still young enough that we wouldn't close it, right? */
if (timercmp(&victim->timestamp_began, &close_cutoff, >)) {
if (!TO_ORIGIN_CIRCUIT(victim)->relaxed_timeout) {