diff options
author | David Goulet <dgoulet@torproject.org> | 2020-01-07 15:03:24 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-14 13:31:08 -0500 |
commit | 59dac38ebe4e6489c2a06d07470023ed5fbdd0aa (patch) | |
tree | 0111634909e9973480e68a0f917b612ca8b56720 /src/test | |
parent | e231cd5b61afcb6640a7e17506bf33ddc6b1d2fe (diff) | |
download | tor-59dac38ebe4e6489c2a06d07470023ed5fbdd0aa.tar.gz tor-59dac38ebe4e6489c2a06d07470023ed5fbdd0aa.zip |
chan: Remove dead var cell handler from channel_t
The variable lenght cells are handled directly by
channel_tls_handle_var_cell() from an OR connection reading its inbuf. The
channel var cell handler (agnostic) was never used.
Closes #32892
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_channel.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/test/test_channel.c b/src/test/test_channel.c index 0353032796..c66170c46f 100644 --- a/src/test/test_channel.c +++ b/src/test/test_channel.c @@ -34,8 +34,6 @@ static int test_chan_accept_cells = 0; static int test_chan_fixed_cells_recved = 0; static cell_t * test_chan_last_seen_fixed_cell_ptr = NULL; -static int test_chan_var_cells_recved = 0; -static var_cell_t * test_chan_last_seen_var_cell_ptr = NULL; static int test_cells_written = 0; static int test_doesnt_want_writes_count = 0; static int test_dumpstats_calls = 0; @@ -113,24 +111,6 @@ chan_test_dumpstats(channel_t *ch, int severity) return; } -/* - * Handle an incoming variable-size cell for unit tests - */ - -static void -chan_test_var_cell_handler(channel_t *ch, - var_cell_t *var_cell) -{ - tt_assert(ch); - tt_assert(var_cell); - - test_chan_last_seen_var_cell_ptr = var_cell; - ++test_chan_var_cells_recved; - - done: - return; -} - static void chan_test_close(channel_t *ch) { @@ -492,11 +472,8 @@ test_channel_dumpstats(void *arg) /* Receive path */ channel_set_cell_handlers(ch, - chan_test_cell_handler, - chan_test_var_cell_handler); + chan_test_cell_handler); tt_ptr_op(channel_get_cell_handler(ch), OP_EQ, chan_test_cell_handler); - tt_ptr_op(channel_get_var_cell_handler(ch), OP_EQ, - chan_test_var_cell_handler); cell = tor_malloc_zero(sizeof(*cell)); old_count = test_chan_fixed_cells_recved; channel_process_cell(ch, cell); @@ -722,7 +699,7 @@ test_channel_inbound_cell(void *arg) /* Setup incoming cell handlers. We don't care about var cell, the channel * layers is not handling those. */ - channel_set_cell_handlers(chan, chan_test_cell_handler, NULL); + channel_set_cell_handlers(chan, chan_test_cell_handler); tt_ptr_op(chan->cell_handler, OP_EQ, chan_test_cell_handler); /* Now process the cell, we should see it. */ old_count = test_chan_fixed_cells_recved; |