diff options
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index ba58c71d2a..8fceae19f6 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -132,8 +132,8 @@ circuit_set_circid_orconn(circuit_t *circ, uint16_t id, ++conn->n_circuits; } -/** Add <b>circ</b> to the list of circuits waiting for us to connect to - * an OR. */ +/** Change the state of <b>circ</b> to <b>state</b>, adding it to or removing + * it from lists as appropriate. */ void circuit_set_state(circuit_t *circ, int state) { @@ -142,9 +142,8 @@ circuit_set_state(circuit_t *circ, int state) return; if (circ->state == CIRCUIT_STATE_OR_WAIT) { /* remove from waiting-circuit list. */ - if (!circuits_pending_or_conns) - circuits_pending_or_conns = smartlist_create(); - smartlist_remove(circuits_pending_or_conns, circ); + if (circuits_pending_or_conns) + smartlist_remove(circuits_pending_or_conns, circ); } if (state == CIRCUIT_STATE_OR_WAIT) { /* add to waiting-circuit list. */ @@ -155,13 +154,6 @@ circuit_set_state(circuit_t *circ, int state) circ->state = state; } -/** Remove <b>circ</b> from the list of circuits waiting for us to connect to - * an OR. */ -void -circuit_clear_state_orwait(circuit_t *circ) -{ -} - /** Add <b>circ</b> to the global list of circuits. This is called only from * within circuit_new. */ |