From 3c9cd463d25f1a1c7f890de723df8d448089eb04 Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Sun, 3 Aug 2008 17:45:24 +0000 Subject: [PATCH] Fix a false assertion when extending a circuit to a relay to which a connection is already established. In that case the circuit should not need to memorize extend info for that relay. circuitbuild.c:389 contains a similar assertion. svn:r16375 --- ChangeLog | 2 +- src/or/circuitbuild.c | 2 +- src/or/or.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 255f0dc1f7..01e9bfa21d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,7 +33,7 @@ Changes in version 0.2.1.3-alpha - 2008-08-03 - Change the implementation of ExcludeNodes and ExcludeExitNodes to be more efficient. Formerly it was quadratic in the number of servers; now it should be linear. Fixes bug 509. - - Save 16-22 bytes per open circuit by moving the n_hop, n_port, + - Save 16-22 bytes per open circuit by moving the n_addr, n_port, and n_conn_id_digest fields into a separate structure that's only needed when the circuit has not yet attached to an n_conn. diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 39e54bae3b..8c54209624 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -791,7 +791,7 @@ circuit_extend(cell_t *cell, circuit_t *circ) return 0; } - tor_assert(circ->n_hop); + tor_assert(!circ->n_hop); /* Connection is already established. */ circ->n_conn = n_conn; log_debug(LD_CIRC,"n_conn is %s:%u", n_conn->_base.address,n_conn->_base.port); diff --git a/src/or/or.h b/src/or/or.h index 14f032fdd8..8bc7cfab3d 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1784,7 +1784,7 @@ typedef struct circuit_t { circid_t n_circ_id; /** The hop to which we want to extend this ciruit. Should be NULL if - * the */ + * the circuit has attached to a connection. */ extend_info_t *n_hop; /** True iff we are waiting for n_conn_cells to become less full before