[or-cvs] bugfix: a circ can"t be youngest if it"s still connecting t...
Roger Dingledine
arma at seul.org
Sun Apr 20 21:56:46 UTC 2003
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home/arma/work/onion/cvs/src/or
Modified Files:
circuit.c command.c
Log Message:
bugfix: a circ can't be youngest if it's still connecting to the first hop
Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- circuit.c 20 Apr 2003 19:47:33 -0000 1.37
+++ circuit.c 20 Apr 2003 21:56:44 -0000 1.38
@@ -255,15 +255,16 @@
for(circ=global_circuitlist;circ;circ = circ->next) {
if(edge_type == EDGE_AP && (!circ->p_conn || circ->p_conn->type == CONN_TYPE_AP)) {
- if(!bestcirc ||
- (circ->state == CIRCUIT_STATE_OPEN && bestcirc->timestamp_created < circ->timestamp_created)) {
+ if(circ->state == CIRCUIT_STATE_OPEN && (!bestcirc ||
+ bestcirc->timestamp_created < circ->timestamp_created)) {
log(LOG_DEBUG,"circuit_get_newest_by_edge_type(): Choosing n_aci %d.", circ->n_aci);
+ assert(circ->n_aci);
bestcirc = circ;
}
}
if(edge_type == EDGE_EXIT && (!circ->n_conn || circ->n_conn->type == CONN_TYPE_EXIT)) {
- if(!bestcirc ||
- (circ->state == CIRCUIT_STATE_OPEN && bestcirc->timestamp_created < circ->timestamp_created))
+ if(circ->state == CIRCUIT_STATE_OPEN && (!bestcirc ||
+ bestcirc->timestamp_created < circ->timestamp_created))
bestcirc = circ;
}
}
@@ -547,7 +548,7 @@
* down the road, maybe we'll consider that eof doesn't mean can't-write
*/
circuit_t *circ;
- connection_t *prevconn, *tmpconn;
+ connection_t *prevconn;
if(!connection_speaks_cells(conn)) {
/* it's an edge conn. need to remove it from the linked list of
Index: command.c
===================================================================
RCS file: /home/or/cvsroot/src/or/command.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- command.c 20 Apr 2003 19:47:33 -0000 1.23
+++ command.c 20 Apr 2003 21:56:44 -0000 1.24
@@ -258,7 +258,6 @@
void command_process_destroy_cell(cell_t *cell, connection_t *conn) {
circuit_t *circ;
- connection_t *tmpconn;
circ = circuit_get_by_aci_conn(cell->aci, conn);
More information about the tor-commits
mailing list