aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuit.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-07-05 06:27:23 +0000
committerRoger Dingledine <arma@torproject.org>2002-07-05 06:27:23 +0000
commitb86fecbf47c51b9d1fd4fca0f828d84420d111fb (patch)
tree8e944b341de08377ddfe650e82d3534ce3137957 /src/or/circuit.c
parentbb163ca83054c2d2c8f36b06f7bda1806ba1d38d (diff)
downloadtor-b86fecbf47c51b9d1fd4fca0f828d84420d111fb.tar
tor-b86fecbf47c51b9d1fd4fca0f828d84420d111fb.tar.gz
general cleanup
svn:r29
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r--src/or/circuit.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index 5f323dd50..6de76a633 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -3,7 +3,7 @@
/********* START VARIABLES **********/
-circuit_t *global_circuitlist=NULL;
+static circuit_t *global_circuitlist=NULL;
/********* END VARIABLES ************/
@@ -22,8 +22,7 @@ void circuit_add(circuit_t *circ) {
void circuit_remove(circuit_t *circ) {
circuit_t *tmpcirc;
- if(!circ || !global_circuitlist)
- return;
+ assert(circ && global_circuitlist);
if(global_circuitlist == circ) {
global_circuitlist = global_circuitlist->next;
@@ -36,11 +35,9 @@ void circuit_remove(circuit_t *circ) {
return;
}
}
-
}
circuit_t *circuit_new(aci_t p_aci, connection_t *p_conn) {
-
circuit_t *circ;
circ = (circuit_t *)malloc(sizeof(circuit_t));
@@ -55,7 +52,7 @@ circuit_t *circuit_new(aci_t p_aci, connection_t *p_conn) {
/* ACIs */
circ->p_aci = p_aci;
- circ->n_aci = 0; /* we need to have identified the next hop to choose a correct ACI */
+ /* circ->n_aci remains 0 because we haven't identified the next hop yet */
circuit_add(circ);
@@ -363,7 +360,6 @@ void circuit_about_to_close_connection(connection_t *conn) {
/* currently, we assume it's too late to flush conn's buf here.
* down the road, maybe we'll consider that eof doesn't mean can't-write
*/
-
circuit_t *circ;
while((circ = circuit_get_by_conn(conn))) {