summaryrefslogtreecommitdiff
path: root/src/or/channeltls.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2013-08-25 08:45:07 -0700
committerAndrea Shepard <andrea@torproject.org>2014-09-30 22:48:24 -0700
commitd438cf1ec9d5de08b8a8fffd7c38b66134fd337c (patch)
tree0ce78e25fde753880ff5bf092c1599d982d0c8a5 /src/or/channeltls.c
parent1987157d0c1e9acb0b88156e7104fbc8a11c5932 (diff)
downloadtor-d438cf1ec9d5de08b8a8fffd7c38b66134fd337c.tar.gz
tor-d438cf1ec9d5de08b8a8fffd7c38b66134fd337c.zip
Implement scheduler mechanism to track lists of channels wanting cells or writes; doesn't actually drive the cell flow from it yet
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r--src/or/channeltls.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 245e33583b..af1aab36d3 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -25,6 +25,7 @@
#include "relay.h"
#include "router.h"
#include "routerlist.h"
+#include "scheduler.h"
/** How many CELL_PADDING cells have we received, ever? */
uint64_t stats_n_padding_cells_processed = 0;
@@ -867,6 +868,10 @@ channel_tls_handle_state_change_on_orconn(channel_tls_t *chan,
* CHANNEL_STATE_MAINT on this.
*/
channel_change_state(base_chan, CHANNEL_STATE_OPEN);
+ /* We might have just become writeable; check and tell the scheduler */
+ if (connection_or_num_cells_writeable(conn) > 0) {
+ scheduler_channel_wants_writes(base_chan);
+ }
} else {
/*
* Not open, so from CHANNEL_STATE_OPEN we go to CHANNEL_STATE_MAINT,