[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] fix bug 245: When modifying the orconn_circid_map map, we w...



Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	circuitlist.c 
Log Message:
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.


Index: circuitlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitlist.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -p -d -r1.89 -r1.90
--- circuitlist.c	5 Jan 2006 21:23:03 -0000	1.89
+++ circuitlist.c	9 Feb 2006 02:42:15 -0000	1.90
@@ -112,8 +112,8 @@ circuit_set_circid_orconn(circuit_t *cir
     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)