diff options
author | Andrea Shepard <andrea@torproject.org> | 2013-12-06 00:04:12 -0800 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2014-09-30 22:49:36 -0700 |
commit | 3530825c53b7a28cf894b64e6d97aa90d0acccae (patch) | |
tree | 445b3ed94bf88e17325b35605c26d66f22cc8279 /src/or/channel.h | |
parent | 283646fd9089a337003dcd7c020e0820c7270662 (diff) | |
download | tor-3530825c53b7a28cf894b64e6d97aa90d0acccae.tar.gz tor-3530825c53b7a28cf894b64e6d97aa90d0acccae.zip |
Eliminate some unnecessary smartlists in scheduler.c
Diffstat (limited to 'src/or/channel.h')
-rw-r--r-- | src/or/channel.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/or/channel.h b/src/or/channel.h index 18f7cfc01e..ced717a531 100644 --- a/src/or/channel.h +++ b/src/or/channel.h @@ -57,6 +57,29 @@ struct channel_s { CHANNEL_CLOSE_FOR_ERROR } reason_for_closing; + /** State variable for use by the scheduler */ + enum { + /* + * The channel is not open, or it has a full output buffer but no queued + * cells. + */ + SCHED_CHAN_IDLE = 0, + /* + * The channel has space on its output buffer to write, but no queued + * cells. + */ + SCHED_CHAN_WAITING_FOR_CELLS, + /* + * The scheduler has queued cells but no output buffer space to write. + */ + SCHED_CHAN_WAITING_TO_WRITE, + /* + * The scheduler has both queued cells and output buffer space, and is + * eligible for the scheduler loop. + */ + SCHED_CHAN_PENDING + } scheduler_state; + /** Timestamps for both cell channels and listeners */ time_t timestamp_created; /* Channel created */ time_t timestamp_active; /* Any activity */ |