]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Implement cell_ewma_enabled()
authorAndrea Shepard <andrea@torproject.org>
Tue, 2 Oct 2012 03:08:36 +0000 (20:08 -0700)
committerAndrea Shepard <andrea@torproject.org>
Wed, 10 Oct 2012 07:44:47 +0000 (00:44 -0700)
src/or/circuitmux_ewma.c
src/or/circuitmux_ewma.h

index 6d4fcc98cfd35a82f99938763cc6b5c24c7d7e2b..c918d6ff8a0c65762344450450db5dcdacf32790 100644 (file)
@@ -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)
index 0968461c999923dd3ac5e29e4ad13b4a07fca434..eec16f3729bcea22e8096ed00318e4af7574578e 100644 (file)
@@ -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);