aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/circuitmux.c')
-rw-r--r--src/or/circuitmux.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index 036fb9570d..2cc0e8fc44 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -1,4 +1,4 @@
-/* * Copyright (c) 2012-2016, The Tor Project, Inc. */
+/* * Copyright (c) 2012-2017, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
@@ -185,7 +185,7 @@ struct chanid_circid_muxinfo_t {
circuitmux_assert_okay(cmux)
#else
#define circuitmux_assert_okay_paranoid(cmux)
-#endif
+#endif /* defined(CMUX_PARANOIA) */
/*
* Static function declarations
@@ -261,13 +261,11 @@ circuitmux_move_active_circ_to_tail(circuitmux_t *cmux, circuit_t *circ,
if (circ->n_mux == cmux) {
next_p = &(circ->next_active_on_n_chan);
prev_p = &(circ->prev_active_on_n_chan);
- direction = CELL_DIRECTION_OUT;
} else {
or_circ = TO_OR_CIRCUIT(circ);
tor_assert(or_circ->p_mux == cmux);
next_p = &(or_circ->next_active_on_p_chan);
prev_p = &(or_circ->prev_active_on_p_chan);
- direction = CELL_DIRECTION_IN;
}
}
tor_assert(next_p);
@@ -1646,7 +1644,6 @@ circuitmux_assert_okay_pass_one(circuitmux_t *cmux)
circid_t circ_id;
circuit_t *circ;
or_circuit_t *or_circ;
- unsigned int circ_is_active;
circuit_t **next_p, **prev_p;
unsigned int n_circuits, n_active_circuits, n_cells;
@@ -1670,8 +1667,6 @@ circuitmux_assert_okay_pass_one(circuitmux_t *cmux)
tor_assert(chan);
circ = circuit_get_by_circid_channel_even_if_marked(circ_id, chan);
tor_assert(circ);
- /* Clear the circ_is_active bit to start */
- circ_is_active = 0;
/* Assert that we know which direction this is going */
tor_assert((*i)->muxinfo.direction == CELL_DIRECTION_OUT ||
@@ -1698,7 +1693,7 @@ circuitmux_assert_okay_pass_one(circuitmux_t *cmux)
* Should this circuit be active? I.e., does the mux know about > 0
* cells on it?
*/
- circ_is_active = ((*i)->muxinfo.cell_count > 0);
+ const int circ_is_active = ((*i)->muxinfo.cell_count > 0);
/* It should be in the linked list iff it's active */
if (circ_is_active) {
@@ -1750,7 +1745,6 @@ circuitmux_assert_okay_pass_two(circuitmux_t *cmux)
circuit_t **next_p, **prev_p;
channel_t *chan;
unsigned int n_active_circuits = 0;
- cell_direction_t direction;
chanid_circid_muxinfo_t search, *hashent = NULL;
tor_assert(cmux);
@@ -1769,7 +1763,7 @@ circuitmux_assert_okay_pass_two(circuitmux_t *cmux)
curr_or_circ = NULL;
next_circ = NULL;
next_p = prev_p = NULL;
- direction = 0;
+ cell_direction_t direction;
/* Figure out if this is n_mux or p_mux */
if (cmux == curr_circ->n_mux) {