summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-09 02:42:15 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-09 02:42:15 +0000
commit2c221dd8db997e822c003f8c532488df4c35746a (patch)
treed50b6f0934e14e0b93c0fa188edf19c9175dccd5
parent1c596156aa2363d86a694fca1328aa01177d9739 (diff)
downloadtor-2c221dd8db997e822c003f8c532488df4c35746a.tar.gz
tor-2c221dd8db997e822c003f8c532488df4c35746a.zip
fix bug 245: When modifying the orconn_circid_map map, we would
sometimes decrement conn->n_circuits even when there was no circuit originally. This caused conn->n_circuits to go negative. We noticed this because we were checking if connections can be closed based on conn->n_circuits == 0, so we were never closing any connection that had ever had a circuit on it. svn:r5931
-rw-r--r--src/or/circuitlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index ab60327a2d..6f5fc26c68 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -112,8 +112,8 @@ circuit_set_circid_orconn(circuit_t *circ, uint16_t id,
found = HT_REMOVE(orconn_circid_map, &orconn_circid_circuit_map, &search);
if (found) {
tor_free(found);
+ --old_conn->n_circuits;
}
- --old_conn->n_circuits;
}
if (conn == NULL)