aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-15 15:42:14 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-15 15:58:00 -0400
commitdb2af2abb03a82e7c71581efa04a45869feba38a (patch)
treef5af77ffc83a6ec5a0056e408a0de545f333429d /src/or/circuitlist.c
parentbe231b0db196513036ee624dc5b9b87c4f898625 (diff)
downloadtor-db2af2abb03a82e7c71581efa04a45869feba38a.tar.gz
tor-db2af2abb03a82e7c71581efa04a45869feba38a.zip
Start converting circuitlist to smartlist.
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index f3a83503ef..f3518751b1 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -38,8 +38,7 @@
/********* START VARIABLES **********/
/** A global list of all circuits at this hop. */
-struct global_circuitlist_s global_circuitlist =
- TOR_LIST_HEAD_INITIALIZER(global_circuitlist);
+static smartlist_t *global_circuitlist = NULL;
/** A list of all the circuits in CIRCUIT_STATE_CHAN_WAIT. */
static smartlist_t *circuits_pending_chans = NULL;
@@ -458,10 +457,12 @@ circuit_close_all_marked(void)
}
/** Return the head of the global linked list of circuits. */
-MOCK_IMPL(struct global_circuitlist_s *,
+MOCK_IMPL(smartlist_t *,
circuit_get_global_list,(void))
{
- return &global_circuitlist;
+ if (NULL == global_circuitlist)
+ global_circuitlist = smartlist_new();
+ return global_circuitlist;
}
/** Function to make circ-\>state human-readable */