[tor-commits] [tor/master] Implement cell_ewma_enabled()
andrea at torproject.org
andrea at torproject.org
Thu Oct 11 02:05:24 UTC 2012
commit 0c4f717b3e83e86fc8646d3803c1e435c6af246d
Author: Andrea Shepard <andrea at torproject.org>
Date: Mon Oct 1 20:08:36 2012 -0700
Implement cell_ewma_enabled()
---
src/or/circuitmux_ewma.c | 8 ++++++++
src/or/circuitmux_ewma.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c
index 6d4fcc9..c918d6f 100644
--- a/src/or/circuitmux_ewma.c
+++ b/src/or/circuitmux_ewma.c
@@ -520,6 +520,7 @@ cell_ewma_to_circuit(cell_ewma_t *ewma)
*
* These tick values are not meant to be shared between Tor instances, or used
* for other purposes. */
+
static unsigned
cell_ewma_tick_from_timeval(const struct timeval *now,
double *remainder_out)
@@ -532,6 +533,13 @@ cell_ewma_tick_from_timeval(const struct timeval *now,
return res;
}
+/** Tell the caller whether ewma_enabled is set */
+int
+cell_ewma_enabled(void)
+{
+ return ewma_enabled;
+}
+
/** Compute and return the current cell_ewma tick. */
unsigned int
cell_ewma_get_tick(void)
diff --git a/src/or/circuitmux_ewma.h b/src/or/circuitmux_ewma.h
index 0968461..eec16f3 100644
--- a/src/or/circuitmux_ewma.h
+++ b/src/or/circuitmux_ewma.h
@@ -20,6 +20,7 @@ extern circuitmux_policy_t ewma_policy;
#endif /* !(_TOR_CIRCUITMUX_EWMA_C) */
/* Externally visible EWMA functions */
+int cell_ewma_enabled(void);
unsigned int cell_ewma_get_tick(void);
void cell_ewma_set_scale_factor(const or_options_t *options,
const networkstatus_t *consensus);
More information about the tor-commits
mailing list