diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-03-14 17:48:45 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-03-14 17:48:45 -0400 |
commit | 1d36a8e9ae766f67097f4c5e522c33ff0c4a693f (patch) | |
tree | 51e218c8c2ca7077b49032dc4a3e48d44430c861 /src/or/connection_edge.c | |
parent | b97d9abd0940037b249a1ee56724dbfed904263b (diff) | |
download | tor-1d36a8e9ae766f67097f4c5e522c33ff0c4a693f.tar.gz tor-1d36a8e9ae766f67097f4c5e522c33ff0c4a693f.zip |
Consider sending stream-level SENDME cells on partial flushes.
Right now, we only consider sending stream-level SENDME cells when we
have completely flushed a connection_edge's outbuf, or when it sends
us a DATA cell. Neither of these is ideal for throughput.
This patch changes the behavior so we now call
connection_edge_consider_sending_sendme when we flush _some_ data from
an edge outbuf.
Fix for bug 2756; bugfix on svn r152.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index f02479fd59..85a52257a8 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -301,6 +301,23 @@ connection_edge_end_errno(edge_connection_t *conn) return connection_edge_end(conn, reason); } +/** We just wrote some data to <b>conn</b>; act appropriately. + * + * (That is, if it's open, consider sending a stream-level sendme cell if we + * have just flushed enough.) + */ +int +connection_edge_flushed_some(edge_connection_t *conn) +{ + switch (conn->_base.state) { + case AP_CONN_STATE_OPEN: + case EXIT_CONN_STATE_OPEN: + connection_edge_consider_sending_sendme(conn); + break; + } + return 0; +} + /** Connection <b>conn</b> has finished writing and has no bytes left on * its outbuf. * |