mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Start converting circuitlist to smartlist.
This commit is contained in:
parent
be231b0db1
commit
db2af2abb0
@ -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 */
|
||||
|
@ -14,9 +14,7 @@
|
||||
|
||||
#include "testsupport.h"
|
||||
|
||||
TOR_LIST_HEAD(global_circuitlist_s, circuit_t);
|
||||
|
||||
MOCK_DECL(struct global_circuitlist_s*, circuit_get_global_list, (void));
|
||||
MOCK_DECL(smartlist_t *, circuit_get_global_list, (void));
|
||||
const char *circuit_state_to_string(int state);
|
||||
const char *circuit_purpose_to_controller_string(uint8_t purpose);
|
||||
const char *circuit_purpose_to_controller_hs_state_string(uint8_t purpose);
|
||||
|
@ -2864,8 +2864,8 @@ typedef struct circuit_t {
|
||||
/** Unique ID for measuring tunneled network status requests. */
|
||||
uint64_t dirreq_id;
|
||||
|
||||
/** Next circuit in linked list of all circuits (global_circuitlist). */
|
||||
TOR_LIST_ENTRY(circuit_t) head;
|
||||
/** Index in smartlist of all circuits (global_circuitlist). */
|
||||
int global_circuitlist_idx;
|
||||
|
||||
/** Next circuit in the doubly-linked ring of circuits waiting to add
|
||||
* cells to n_conn. NULL if we have no cells pending, or if we're not
|
||||
|
Loading…
Reference in New Issue
Block a user