summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-08-10 04:13:18 -0400
committerRoger Dingledine <arma@torproject.org>2009-08-10 04:13:18 -0400
commite50b7768b94bbcccef77be255920e3aac80a9555 (patch)
tree6177b07062ef3f3f72b9f327a4da931c6cf9c29f /src/or
parente53ee805a92e5e8f8afc8aa512d33464be710733 (diff)
downloadtor-e50b7768b94bbcccef77be255920e3aac80a9555.tar.gz
tor-e50b7768b94bbcccef77be255920e3aac80a9555.zip
Send sendmes when we're down 100 cells, not 101.
Send circuit or stream sendme cells when our window has decreased by 100 cells, not when it has decreased by 101 cells. Bug uncovered by Karsten when testing the "reduce circuit window" performance patch. Bugfix on the 54th commit on Tor -- from July 2002, before the release of Tor 0.0.0. This is the new winner of the oldest-bug prize.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/relay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 3419e3d190..b26c582b82 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1358,7 +1358,7 @@ connection_edge_consider_sending_sendme(edge_connection_t *conn)
return;
}
- while (conn->deliver_window < STREAMWINDOW_START - STREAMWINDOW_INCREMENT) {
+ while (conn->deliver_window <= STREAMWINDOW_START - STREAMWINDOW_INCREMENT) {
log_debug(conn->cpath_layer?LD_APP:LD_EXIT,
"Outbuf %d, Queuing stream sendme.",
(int)conn->_base.outbuf_flushlen);
@@ -1472,7 +1472,7 @@ circuit_consider_sending_sendme(circuit_t *circ, crypt_path_t *layer_hint)
{
// log_fn(LOG_INFO,"Considering: layer_hint is %s",
// layer_hint ? "defined" : "null");
- while ((layer_hint ? layer_hint->deliver_window : circ->deliver_window) <
+ while ((layer_hint ? layer_hint->deliver_window : circ->deliver_window) <=
CIRCWINDOW_START - CIRCWINDOW_INCREMENT) {
log_debug(LD_CIRC,"Queuing circuit sendme.");
if (layer_hint)