diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-12-18 22:33:02 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-12-18 22:33:02 -0500 |
commit | 05a2473b7f38d6c5cab0c98aec7ab61aec3ac6cc (patch) | |
tree | 84f3e62634ef7f331f44d0c0f5f98afd9bbbaee6 /src/or/circuitlist.c | |
parent | 7edae5898416dbd291d9e5e9f75e0b24153e73ea (diff) | |
parent | 5e2eaa37f1984e3de122568062d364283402bdf3 (diff) | |
download | tor-05a2473b7f38d6c5cab0c98aec7ab61aec3ac6cc.tar.gz tor-05a2473b7f38d6c5cab0c98aec7ab61aec3ac6cc.zip |
Merge branch 'ewma'
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 83cb75ea9f..24732f2aea 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -385,6 +385,12 @@ init_circuit_base(circuit_t *circ) circ->package_window = circuit_initial_package_window(); circ->deliver_window = CIRCWINDOW_START; + /* Initialize the cell_ewma_t structure */ + circ->n_cell_ewma.last_adjusted_tick = cell_ewma_get_tick(); + circ->n_cell_ewma.cell_count = 0.0; + circ->n_cell_ewma.heap_index = -1; + circ->n_cell_ewma.is_for_p_conn = 0; + circuit_add(circ); } @@ -432,6 +438,16 @@ or_circuit_new(circid_t p_circ_id, or_connection_t *p_conn) init_circuit_base(TO_CIRCUIT(circ)); + /* Initialize the cell_ewma_t structure */ + + /* Initialize the cell counts to 0 */ + circ->p_cell_ewma.cell_count = 0.0; + circ->p_cell_ewma.last_adjusted_tick = cell_ewma_get_tick(); + circ->p_cell_ewma.is_for_p_conn = 1; + + /* It's not in any heap yet. */ + circ->p_cell_ewma.heap_index = -1; + return circ; } |