aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-07-11 09:57:58 -0400
committerNick Mathewson <nickm@torproject.org>2012-07-18 10:28:55 -0400
commit5ade2786050dcf07ee6491145add86da5c21739d (patch)
tree6fef025fe3b09c88d29df005d487ab9968f3b935 /src/or
parentb355ddb20f534d772dcb42737ceb1d0264e2c3f1 (diff)
downloadtor-5ade2786050dcf07ee6491145add86da5c21739d.tar
tor-5ade2786050dcf07ee6491145add86da5c21739d.tar.gz
Check ewma_enabled before doing circ-has-become-inactive check
This avoids a possible crash bug in flush_from_first_active_circuit. Fixes bug 6341; bugfix on 0.2.2.7-alpha. Bug reported and fixed by a pseudonymous user on IRC.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/relay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 3e418ea13..b1913e766 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2464,7 +2464,7 @@ connection_or_flush_from_first_active_circuit(or_connection_t *conn, int max,
tor_assert(tmp == cell_ewma);
add_cell_ewma_to_conn(conn, cell_ewma);
}
- if (circ != conn->active_circuits) {
+ if (!ewma_enabled && circ != conn->active_circuits) {
/* If this happens, the current circuit just got made inactive by
* a call in connection_write_to_buf(). That's nothing to worry about:
* circuit_make_inactive_on_conn() already advanced conn->active_circuits