aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-15 13:53:53 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-15 13:58:24 -0500
commit60b01c6d5e7afbb4eee6f7e57583fae4a7278d58 (patch)
tree61a1e8752614ca68d23642420dd5d55fb136b006 /src/or/or.h
parent296381eda0efd1c849834b49547a8bb7fe773e71 (diff)
downloadtor-60b01c6d5e7afbb4eee6f7e57583fae4a7278d58.tar.gz
tor-60b01c6d5e7afbb4eee6f7e57583fae4a7278d58.zip
Change interface for configuring cell ewma algorithm.
The rule is now: take the value from the CircuitPriorityHalflife config option if it is set. If it zero, disable the cell_ewma algorithm. If it is set, use it to calculate the scaling factor. If it is not set, look for a CircPriorityHalflifeMsec parameter in the consensus networkstatus. If *that* is zero, then disable the cell_ewma algorithm; if it is set, use it to calculate the scaling factor. If it is not set at all, disable the algorithm.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/or/or.h b/src/or/or.h
index fd913ce4ef..745a0ce919 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2783,13 +2783,20 @@ typedef struct {
* to make this false. */
int ReloadTorrcOnSIGHUP;
- /* The EWMA parameters for circuit selection within a connection.
- * The most recent EWMAInterval seconds will account for an
- * EWMASignificance (between 0 and 1) portion of the weight.
- * If these values are negative, use the global defaults (soon to be
- * set in the consensus). */
- double EWMASignificance;
- double EWMAInterval;
+ /* The main parameter for picking circuits within a connection.
+ *
+ * If this value is positive, when picking a cell to relay on a connection,
+ * we always relay from the circuit whose weighted cell count is lowest.
+ * Cells are weighted exponentially such that if one cell is sent
+ * 'CircuitPriorityHalflife' seconds before another, it counts for half as
+ * much.
+ *
+ * If this value is zero, we're disabling the cell-EWMA algorithm.
+ *
+ * If this value is negative, we're using the default approach
+ * according to either Tor or a parameter set in the consensus.
+ */
+ double CircuitPriorityHalflife;
} or_options_t;
@@ -4491,7 +4498,8 @@ const char *decode_address_from_payload(tor_addr_t *addr_out,
const char *payload,
int payload_len);
unsigned cell_ewma_get_tick(void);
-void cell_ewma_set_scale_factor(or_options_t *options);
+void cell_ewma_set_scale_factor(or_options_t *options,
+ networkstatus_t *consensus);
/********************************* rephist.c ***************************/