[tor-commits] [tor/release-0.2.9] Merge branch 'maint-0.2.5' into maint-0.2.8
nickm at torproject.org
nickm at torproject.org
Thu Dec 21 15:58:34 UTC 2017
commit 7d845976e3897fac8e78a4a26688ac57b660151b
Merge: 877dd1d6c 920208776
Author: Nick Mathewson <nickm at torproject.org>
Date: Thu Dec 21 10:43:06 2017 -0500
Merge branch 'maint-0.2.5' into maint-0.2.8
changes/bug24666 | 7 ++++
src/or/circuitmux.c | 34 +++++--------------
src/or/circuitmux.h | 2 +-
src/or/or.h | 15 +++++++++
src/or/relay.c | 82 ++++++++++++++++++++++++++++++++++++++++++++--
src/or/relay.h | 8 +++++
src/test/test_circuitmux.c | 12 +++----
7 files changed, 126 insertions(+), 34 deletions(-)
diff --cc src/or/relay.h
index e15551ca5,9d160b7b9..c4f98d92f
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@@ -60,9 -63,15 +60,16 @@@ void cell_queue_append_packed_copy(circ
void append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
cell_t *cell, cell_direction_t direction,
streamid_t fromstream);
+
+ void destroy_cell_queue_init(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_clear(destroy_cell_queue_t *queue);
+ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
+ circid_t circid,
+ uint8_t reason);
+
void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
-int channel_flush_from_first_active_circuit(channel_t *chan, int max);
+MOCK_DECL(int, channel_flush_from_first_active_circuit,
+ (channel_t *chan, int max));
void assert_circuit_mux_okay(channel_t *chan);
void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
const char *file, int lineno);
diff --cc src/test/test_circuitmux.c
index 9e8fb5496,d6b658c27..1ffa17247
--- a/src/test/test_circuitmux.c
+++ b/src/test/test_circuitmux.c
@@@ -34,11 -33,13 +34,12 @@@ test_cmux_destroy_cell_queue(void *arg
circuitmux_t *cmux = NULL;
channel_t *ch = NULL;
circuit_t *circ = NULL;
- cell_queue_t *cq = NULL;
+ destroy_cell_queue_t *cq = NULL;
packed_cell_t *pc = NULL;
+ destroy_cell_t *dc = NULL;
-#ifdef ENABLE_MEMPOOLS
- init_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
+ scheduler_init();
+
(void) arg;
cmux = circuitmux_alloc();
@@@ -61,20 -62,23 +62,19 @@@
tt_assert(!circ);
tt_assert(cq);
- tt_int_op(cq->n, ==, 3);
+ tt_int_op(cq->n, OP_EQ, 3);
- pc = cell_queue_pop(cq);
- tt_assert(pc);
- tt_mem_op(pc->body, OP_EQ, "\x00\x00\x00\x64\x04\x0a\x00\x00\x00", 9);
- packed_cell_free(pc);
- pc = NULL;
+ dc = destroy_cell_queue_pop(cq);
+ tt_assert(dc);
- tt_uint_op(dc->circid, ==, 100);
++ tt_uint_op(dc->circid, OP_EQ, 100);
- tt_int_op(circuitmux_num_cells(cmux), ==, 2);
+ tt_int_op(circuitmux_num_cells(cmux), OP_EQ, 2);
done:
circuitmux_free(cmux);
channel_free(ch);
packed_cell_free(pc);
+ tor_free(dc);
-
-#ifdef ENABLE_MEMPOOLS
- free_cell_pool();
-#endif /* ENABLE_MEMPOOLS */
}
struct testcase_t circuitmux_tests[] = {
More information about the tor-commits
mailing list