From: Andrea Shepard Date: Tue, 2 Oct 2012 03:05:03 +0000 (-0700) Subject: Implement channel_set_cmux_policy_everywhere() X-Git-Tag: tor-0.2.4.4-alpha~37^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8afe41b481caa984fa6b4a0fbbf626d4cd22ce59;p=thirdparty%2Ftor.git Implement channel_set_cmux_policy_everywhere() --- diff --git a/src/or/channel.c b/src/or/channel.c index 4ad5bf15f3..880fa63ca5 100644 --- a/src/or/channel.c +++ b/src/or/channel.c @@ -2695,6 +2695,22 @@ channel_listener_dumpstats(int severity) } } +/** + * Set the cmux policy on all active channels + */ + +void +channel_set_cmux_policy_everywhere(circuitmux_policy_t *pol) +{ + if (!active_channels) return; + + SMARTLIST_FOREACH_BEGIN(active_channels, channel_t *, curr) { + if (curr->cmux) { + circuitmux_set_policy(curr->cmux, pol); + } + } SMARTLIST_FOREACH_END(curr); +} + /** * Clean up channels * diff --git a/src/or/channel.h b/src/or/channel.h index 4d3db41cef..cb9835a9f5 100644 --- a/src/or/channel.h +++ b/src/or/channel.h @@ -291,6 +291,9 @@ void channel_free_all(void); void channel_dumpstats(int severity); void channel_listener_dumpstats(int severity); +/* Set the cmux policy on all active channels */ +void channel_set_cmux_policy_everywhere(circuitmux_policy_t *pol); + #ifdef _TOR_CHANNEL_INTERNAL /* Channel operations for subclasses and internal use only */