diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-03-03 01:37:54 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-03-03 01:37:54 +0000 |
commit | 5985aef18a5b441172dcbfea161e6d3e364ee111 (patch) | |
tree | 5707b7b18829c84b5dfa1df536b7ecbf6c75f768 /src | |
parent | d16f142fa95df836c7fea2b5255916bfeef53da8 (diff) | |
download | tor-5985aef18a5b441172dcbfea161e6d3e364ee111.tar tor-5985aef18a5b441172dcbfea161e6d3e364ee111.tar.gz |
Nth time is the charm on list manip.
svn:r1201
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuit.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 22a79a764..11eb7a694 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -65,14 +65,16 @@ void circuit_close_all_marked() global_circuitlist = tmp; } - if(!global_circuitlist) - return; - - for (tmp = global_circuitlist; tmp->next; tmp=tmp->next) { - while (tmp->next && tmp->next->marked_for_close) { + tmp = global_circuitlist; + while (tmp && tmp->next) { + if (tmp->next->marked_for_close) { m = tmp->next->next; circuit_free(tmp->next); tmp->next = m; + /* Need to check new tmp->next; don't advance tmp. */ + } else { + /* Advance tmp. */ + tmp = tmp->next; } } } @@ -1266,7 +1268,7 @@ void assert_circuit_ok(const circuit_t *c) assert(c); assert(c->magic == CIRCUIT_MAGIC); - return 0; /* XXX fix the rest of this. */ + return; assert(c->n_addr); assert(c->n_port); |