diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-19 13:53:52 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-21 10:29:01 -0500 |
commit | 520cf21793e9c6b662c76c02235315f898d10fb9 (patch) | |
tree | 821564c2f105daa4d71980d866d825a2b64cd0c3 /src/or/relay.h | |
parent | 1deda2106b0af16daaecc2e27982a28054e28345 (diff) | |
download | tor-520cf21793e9c6b662c76c02235315f898d10fb9.tar.gz tor-520cf21793e9c6b662c76c02235315f898d10fb9.zip |
Move destroy cells into a separate queue type of their own, to save RAM
We've been seeing problems with destroy cells queues taking up a
huge amount of RAM. We can mitigate this, since while a full packed
destroy cell takes 514 bytes, we only need 5 bytes to remember a
circuit ID and a reason.
Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues
were introduced.
Diffstat (limited to 'src/or/relay.h')
-rw-r--r-- | src/or/relay.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/relay.h b/src/or/relay.h index 969c6fb61d..9d160b7b94 100644 --- a/src/or/relay.h +++ b/src/or/relay.h @@ -63,6 +63,13 @@ void cell_queue_append_packed_copy(circuit_t *circ, cell_queue_t *queue, 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); void assert_circuit_mux_okay(channel_t *chan); @@ -101,6 +108,7 @@ STATIC int connection_edge_process_resolved_cell(edge_connection_t *conn, const relay_header_t *rh); STATIC packed_cell_t *packed_cell_new(void); STATIC packed_cell_t *cell_queue_pop(cell_queue_t *queue); +STATIC destroy_cell_t *destroy_cell_queue_pop(destroy_cell_queue_t *queue); STATIC size_t cell_queues_get_total_allocation(void); STATIC int cell_queues_check_size(void); #endif |