summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-04-20 21:56:44 +0000
committerRoger Dingledine <arma@torproject.org>2003-04-20 21:56:44 +0000
commit59e70bcae695ac40344ae4e5e5bd9de44e1ba8ce (patch)
treef411b1c75cc9e9c36c247e39e1de8a28e7c6641e /src/or
parentf54186aa916326ad097c32fa02c4e85d6697fc39 (diff)
downloadtor-59e70bcae695ac40344ae4e5e5bd9de44e1ba8ce.tar.gz
tor-59e70bcae695ac40344ae4e5e5bd9de44e1ba8ce.zip
bugfix: a circ can't be youngest if it's still connecting to the first hop
svn:r255
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuit.c11
-rw-r--r--src/or/command.c1
2 files changed, 6 insertions, 6 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index fcfdedd587..70173c8ce9 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -255,15 +255,16 @@ circuit_t *circuit_get_newest_by_edge_type(char edge_type) {
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 @@ void circuit_about_to_close_connection(connection_t *conn) {
* 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
diff --git a/src/or/command.c b/src/or/command.c
index 00a079e00d..d41ca17f72 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -258,7 +258,6 @@ void command_process_data_cell(cell_t *cell, connection_t *conn) {
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);