aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index bac2b2e642..3e92c43748 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -12,8 +12,11 @@
#define CONFIG_PRIVATE
#include "or.h"
+#include "channel.h"
#include "circuitbuild.h"
#include "circuitlist.h"
+#include "circuitmux.h"
+#include "circuitmux_ewma.h"
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
@@ -1167,6 +1170,7 @@ options_act(const or_options_t *old_options)
char *msg=NULL;
const int transition_affects_workers =
old_options && options_transition_affects_workers(old_options, options);
+ int old_ewma_enabled;
/* disable ptrace and later, other basic debugging techniques */
{
@@ -1374,8 +1378,16 @@ options_act(const or_options_t *old_options)
connection_bucket_init();
#endif
+ old_ewma_enabled = cell_ewma_enabled();
/* Change the cell EWMA settings */
cell_ewma_set_scale_factor(options, networkstatus_get_latest_consensus());
+ /* If we just enabled ewma, set the cmux policy on all active channels */
+ if (cell_ewma_enabled() && !old_ewma_enabled) {
+ channel_set_cmux_policy_everywhere(&ewma_policy);
+ } else if (!cell_ewma_enabled() && old_ewma_enabled) {
+ /* Turn it off everywhere */
+ channel_set_cmux_policy_everywhere(NULL);
+ }
/* Update the BridgePassword's hashed version as needed. We store this as a
* digest so that we can do side-channel-proof comparisons on it.