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

index 4ad5bf15f38854931a2784830b5a9f3be9955502..880fa63ca5ce4ee973e880c2784bcb431980a727 100644 (file)
@@ -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
  *
index 4d3db41cefff5e48ac9b95ba6f9dd31bf562789d..cb9835a9f5878583e206473deadf04c86851dd40 100644 (file)
@@ -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 */