]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Set circuitmux policy on new channels in channeltls.c
authorAndrea Shepard <andrea@torproject.org>
Tue, 2 Oct 2012 03:27:01 +0000 (20:27 -0700)
committerAndrea Shepard <andrea@torproject.org>
Wed, 10 Oct 2012 07:44:47 +0000 (00:44 -0700)
src/or/channeltls.c

index bc7e3ec9d353ca3f0c92c57860993b7b50526b1b..764de80a784354d6249af3439ad3ba37e8436163 100644 (file)
@@ -17,6 +17,7 @@
 #include "channel.h"
 #include "channeltls.h"
 #include "circuitmux.h"
+#include "circuitmux_ewma.h"
 #include "config.h"
 #include "connection.h"
 #include "connection_or.h"
@@ -129,7 +130,9 @@ channel_tls_connect(const tor_addr_t *addr, uint16_t port,
   channel_mark_outgoing(chan);
 
   chan->cmux = circuitmux_alloc();
-  /* TODO set cmux policy */
+  if (cell_ewma_enabled()) {
+    circuitmux_set_policy(chan->cmux, &ewma_policy);
+  }
 
   /* Set up or_connection stuff */
   tlschan->conn = connection_or_connect(addr, port, id_digest, tlschan);
@@ -262,7 +265,9 @@ channel_tls_handle_incoming(or_connection_t *orconn)
   channel_mark_incoming(chan);
 
   chan->cmux = circuitmux_alloc();
-  /* TODO set cmux policy */
+  if (cell_ewma_enabled()) {
+    circuitmux_set_policy(chan->cmux, &ewma_policy);
+  }
 
   /* If we got one, we should register it */
   if (chan) channel_register(chan);