aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2018-01-31 05:26:06 -0500
committerRoger Dingledine <arma@torproject.org>2018-01-31 05:26:06 -0500
commit3d9dcb49eb50b6c4681e66c847a320ace1d1c843 (patch)
treeac222b48b46aa9cc89c62adc882cff5d2228cee9 /src/or
parent7f2e23e7acc0735e5ae933535a1b617a0860e528 (diff)
downloadtor-3d9dcb49eb50b6c4681e66c847a320ace1d1c843.tar.gz
tor-3d9dcb49eb50b6c4681e66c847a320ace1d1c843.zip
count flushing as channel activity
Stop adding unneeded channel padding right after we finish flushing to a connection that has been trying to flush for many seconds. Instead, treat all partial or complete flushes as activity on the channel, which will defer the time until we need to add padding. This fix should resolve confusing and scary log messages like "Channel padding timeout scheduled 221453ms in the past." Fixes bug 22212; bugfix on 0.3.1.1-alpha. I think technically we could resolve bug 22212 by adding a call to channel_timestamp_active() only in the finished_flushing case. But I added a call in the flushed_some case too since that seems to more accurately reflect the notion of "active".
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection_or.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index fcd281da26..85459b62e8 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -591,6 +591,10 @@ connection_or_flushed_some(or_connection_t *conn)
{
size_t datalen;
+ /* Update the channel's active timestamp if there is one */
+ if (conn->chan)
+ channel_timestamp_active(TLS_CHAN_TO_BASE(conn->chan));
+
/* The channel will want to update its estimated queue size */
channel_update_xmit_queue_size(TLS_CHAN_TO_BASE(conn->chan));
@@ -654,6 +658,11 @@ connection_or_finished_flushing(or_connection_t *conn)
tor_fragile_assert();
return -1;
}
+
+ /* Update the channel's active timestamp if there is one */
+ if (conn->chan)
+ channel_timestamp_active(TLS_CHAN_TO_BASE(conn->chan));
+
return 0;
}