diff options
author | David Goulet <dgoulet@torproject.org> | 2018-02-15 13:59:51 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-02-15 14:02:09 -0500 |
commit | 9d68647ba3fc0774653be7ac994f8a6307b146f9 (patch) | |
tree | bcc08b48ce5073ee1e77d53f95a1c8dd1a1dd4a2 /src/or/relay.c | |
parent | 9af5b625e8be64ed63ad5b19ae6c4b450e977ce0 (diff) | |
download | tor-9d68647ba3fc0774653be7ac994f8a6307b146f9.tar.gz tor-9d68647ba3fc0774653be7ac994f8a6307b146f9.zip |
cmux: Remove PARANOIA assert functions
The reason to do so is because these functions haven't been used in years so
since 0.2.4, every callsite is NOP.
In future commits, we'll remove the round robin circuit policy which is mostly
validated within those function.
This simplifies the code greatly and remove dead code for which we never had a
configure option in the first place nor an easy way to use them in production.
Part of #25268
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 506b7eccb3..caf031f7f5 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -2397,13 +2397,6 @@ circuit_consider_sending_sendme(circuit_t *circ, crypt_path_t *layer_hint) } } -#ifdef ACTIVE_CIRCUITS_PARANOIA -#define assert_cmux_ok_paranoid(chan) \ - assert_circuit_mux_okay(chan) -#else -#define assert_cmux_ok_paranoid(chan) -#endif /* defined(ACTIVE_CIRCUITS_PARANOIA) */ - /** The total number of cells we have allocated. */ static size_t total_cells_allocated = 0; @@ -2691,16 +2684,12 @@ update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction, } tor_assert(circuitmux_attached_circuit_direction(cmux, circ) == direction); - assert_cmux_ok_paranoid(chan); - /* Update the number of cells we have for the circuit mux */ if (direction == CELL_DIRECTION_OUT) { circuitmux_set_num_cells(cmux, circ, circ->n_chan_cells.n); } else { circuitmux_set_num_cells(cmux, circ, or_circ->p_chan_cells.n); } - - assert_cmux_ok_paranoid(chan); } /** Remove all circuits from the cmux on <b>chan</b>. @@ -2845,7 +2834,6 @@ channel_flush_from_first_active_circuit, (channel_t *chan, int max)) } /* If it returns NULL, no cells left to send */ if (!circ) break; - assert_cmux_ok_paranoid(chan); if (circ->n_chan == chan) { queue = &circ->n_chan_cells; @@ -2949,8 +2937,6 @@ channel_flush_from_first_active_circuit, (channel_t *chan, int max)) } /* Okay, we're done sending now */ - assert_cmux_ok_paranoid(chan); - return n_flushed; } @@ -3101,17 +3087,6 @@ circuit_clear_cell_queue(circuit_t *circ, channel_t *chan) update_circuit_on_cmux(circ, direction); } -/** Fail with an assert if the circuit mux on chan is corrupt - */ -void -assert_circuit_mux_okay(channel_t *chan) -{ - tor_assert(chan); - tor_assert(chan->cmux); - - circuitmux_assert_okay(chan->cmux); -} - /** Return 1 if we shouldn't restart reading on this circuit, even if * we get a SENDME. Else return 0. */ |