diff options
author | Andrea Shepard <andrea@torproject.org> | 2013-10-29 02:13:53 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2014-09-30 22:48:26 -0700 |
commit | 2efbab2aaf98d8f8f0df504efd4fdd0fac77d354 (patch) | |
tree | 2099658b3d71719d09c16db6590453ebb6f94b95 /src/or/scheduler.c | |
parent | 472b62bfe4edb2f5e332c997be2ec69bdf590660 (diff) | |
download | tor-2efbab2aaf98d8f8f0df504efd4fdd0fac77d354.tar.gz tor-2efbab2aaf98d8f8f0df504efd4fdd0fac77d354.zip |
Provide generic mechanism for scheduler to query writeable cells on a channel
Diffstat (limited to 'src/or/scheduler.c')
-rw-r--r-- | src/or/scheduler.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/or/scheduler.c b/src/or/scheduler.c index e2dcdb5d32..7023eaae0a 100644 --- a/src/or/scheduler.c +++ b/src/or/scheduler.c @@ -324,6 +324,7 @@ void scheduler_run(void) { smartlist_t *tmp = NULL; + int n_cells; log_debug(LD_SCHED, "We have a chance to run the scheduler"); @@ -337,9 +338,18 @@ scheduler_run(void) channels_pending = smartlist_new(); SMARTLIST_FOREACH_BEGIN(tmp, channel_t *, chan) { - log_debug(LD_SCHED, - "Scheduler saw pending channel " U64_FORMAT " at %p", - U64_PRINTF_ARG(chan->global_identifier), chan); + n_cells = channel_num_cells_writeable(chan); + if (n_cells > 0) { + log_debug(LD_SCHED, + "Scheduler saw pending channel " U64_FORMAT " at %p with " + "%d cells writeable", + U64_PRINTF_ARG(chan->global_identifier), chan, n_cells); + } else { + log_info(LD_SCHED, + "Scheduler saw pending channel " U64_FORMAT " at %p with " + "no cells writeable", + U64_PRINTF_ARG(chan->global_identifier), chan); + } } SMARTLIST_FOREACH_END(chan); smartlist_free(tmp); |