mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add all the missed scheduler_state assignments
This commit is contained in:
@@ -611,7 +611,7 @@ kist_scheduler_run(void)
|
||||
if (!CHANNEL_IS_OPEN(chan)) {
|
||||
/* Channel isn't open so we put it back in IDLE mode. It is either
|
||||
* renegotiating its TLS session or about to be released. */
|
||||
chan->scheduler_state = SCHED_CHAN_IDLE;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_IDLE);
|
||||
continue;
|
||||
}
|
||||
/* flush_result has the # cells flushed */
|
||||
@@ -632,7 +632,7 @@ kist_scheduler_run(void)
|
||||
"stop scheduling it this round.",
|
||||
channel_state_to_string(chan->state),
|
||||
chan->scheduler_state);
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_FOR_CELLS;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_FOR_CELLS);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -659,14 +659,14 @@ kist_scheduler_run(void)
|
||||
* SCHED_CHAN_WAITING_FOR_CELLS to SCHED_CHAN_IDLE and seeing if Tor
|
||||
* starts having serious throughput issues. Best done in shadow/chutney.
|
||||
*/
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_FOR_CELLS;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_FOR_CELLS);
|
||||
log_debug(LD_SCHED, "chan=%" PRIu64 " now waiting_for_cells",
|
||||
chan->global_identifier);
|
||||
} else if (!channel_more_to_flush(chan)) {
|
||||
|
||||
/* Case 2: no more cells to send, but still open for writes */
|
||||
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_FOR_CELLS;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_FOR_CELLS);
|
||||
log_debug(LD_SCHED, "chan=%" PRIu64 " now waiting_for_cells",
|
||||
chan->global_identifier);
|
||||
} else if (!socket_can_write(&socket_table, chan)) {
|
||||
@@ -680,7 +680,7 @@ kist_scheduler_run(void)
|
||||
* after the scheduling loop is over. They can hopefully be taken care of
|
||||
* in the next scheduling round.
|
||||
*/
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_TO_WRITE;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_TO_WRITE);
|
||||
if (!to_readd) {
|
||||
to_readd = smartlist_new();
|
||||
}
|
||||
@@ -691,7 +691,7 @@ kist_scheduler_run(void)
|
||||
|
||||
/* Case 4: cells to send, and still open for writes */
|
||||
|
||||
chan->scheduler_state = SCHED_CHAN_PENDING;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_PENDING);
|
||||
smartlist_pqueue_add(cp, scheduler_compare_channels,
|
||||
offsetof(channel_t, sched_heap_idx), chan);
|
||||
}
|
||||
@@ -711,7 +711,7 @@ kist_scheduler_run(void)
|
||||
/* Re-add any channels we need to */
|
||||
if (to_readd) {
|
||||
SMARTLIST_FOREACH_BEGIN(to_readd, channel_t *, readd_chan) {
|
||||
readd_chan->scheduler_state = SCHED_CHAN_PENDING;
|
||||
scheduler_set_channel_state(readd_chan, SCHED_CHAN_PENDING);
|
||||
if (!smartlist_contains(cp, readd_chan)) {
|
||||
smartlist_pqueue_add(cp, scheduler_compare_channels,
|
||||
offsetof(channel_t, sched_heap_idx), readd_chan);
|
||||
|
||||
@@ -89,7 +89,7 @@ vanilla_scheduler_run(void)
|
||||
|
||||
if (flushed < n_cells) {
|
||||
/* We ran out of cells to flush */
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_FOR_CELLS;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_FOR_CELLS);
|
||||
log_debug(LD_SCHED,
|
||||
"Channel " U64_FORMAT " at %p "
|
||||
"entered waiting_for_cells from pending",
|
||||
@@ -110,7 +110,7 @@ vanilla_scheduler_run(void)
|
||||
chan);
|
||||
} else {
|
||||
/* It's waiting to be able to write more */
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_TO_WRITE;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_TO_WRITE);
|
||||
log_debug(LD_SCHED,
|
||||
"Channel " U64_FORMAT " at %p "
|
||||
"entered waiting_to_write from pending",
|
||||
@@ -124,7 +124,7 @@ vanilla_scheduler_run(void)
|
||||
* It can still accept writes, so it goes to
|
||||
* waiting_for_cells
|
||||
*/
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_FOR_CELLS;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_FOR_CELLS);
|
||||
log_debug(LD_SCHED,
|
||||
"Channel " U64_FORMAT " at %p "
|
||||
"entered waiting_for_cells from pending",
|
||||
@@ -135,7 +135,7 @@ vanilla_scheduler_run(void)
|
||||
* We exactly filled up the output queue with all available
|
||||
* cells; go to idle.
|
||||
*/
|
||||
chan->scheduler_state = SCHED_CHAN_IDLE;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_IDLE);
|
||||
log_debug(LD_SCHED,
|
||||
"Channel " U64_FORMAT " at %p "
|
||||
"become idle from pending",
|
||||
@@ -156,14 +156,14 @@ vanilla_scheduler_run(void)
|
||||
"no cells writeable",
|
||||
U64_PRINTF_ARG(chan->global_identifier), chan);
|
||||
/* Put it back to WAITING_TO_WRITE */
|
||||
chan->scheduler_state = SCHED_CHAN_WAITING_TO_WRITE;
|
||||
scheduler_set_channel_state(chan, SCHED_CHAN_WAITING_TO_WRITE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Readd any channels we need to */
|
||||
if (to_readd) {
|
||||
SMARTLIST_FOREACH_BEGIN(to_readd, channel_t *, readd_chan) {
|
||||
readd_chan->scheduler_state = SCHED_CHAN_PENDING;
|
||||
scheduler_set_channel_state(readd_chan, SCHED_CHAN_PENDING);
|
||||
smartlist_pqueue_add(cp,
|
||||
scheduler_compare_channels,
|
||||
offsetof(channel_t, sched_heap_idx),
|
||||
|
||||
Reference in New Issue
Block a user