diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-11 15:53:06 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-11 15:53:06 -0400 |
commit | affbe376f9a15c7c839287b8127d3bd9ac2eab02 (patch) | |
tree | 976f285219f8249cbe8c607c7b269e6bb0784362 /src/or | |
parent | 89c5b8d7dc4b22a3c91241a6e91edc41c2c6b362 (diff) | |
parent | ae1aea4cc490658e917b0c08584c7115a57da00b (diff) | |
download | tor-affbe376f9a15c7c839287b8127d3bd9ac2eab02.tar.gz tor-affbe376f9a15c7c839287b8127d3bd9ac2eab02.zip |
Merge branch 'maint-0.3.3' into maint-0.3.4
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/channelpadding.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c index a8b9a2b47b..3dbdd019ab 100644 --- a/src/or/channelpadding.c +++ b/src/or/channelpadding.c @@ -379,7 +379,8 @@ channelpadding_send_padding_cell_for_callback(channel_t *chan) chan->pending_padding_callback = 0; if (monotime_coarse_is_zero(&chan->next_padding_time) || - chan->has_queued_writes(chan)) { + chan->has_queued_writes(chan) || + (chan->cmux && circuitmux_num_cells(chan->cmux))) { /* We must have been active before the timer fired */ monotime_coarse_zero(&chan->next_padding_time); return; @@ -755,7 +756,11 @@ channelpadding_decide_to_pad_channel(channel_t *chan) return CHANNELPADDING_WONTPAD; } - if (!chan->has_queued_writes(chan)) { + /* There should always be a cmux on the circuit. After that, + * only schedule padding if there are no queued writes and no + * queued cells in circuitmux queues. */ + if (chan->cmux && !chan->has_queued_writes(chan) && + !circuitmux_num_cells(chan->cmux)) { int is_client_channel = 0; if (CHANNEL_IS_CLIENT(chan, options)) { |