aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-04-08 22:31:48 +0000
committerRoger Dingledine <arma@torproject.org>2003-04-08 22:31:48 +0000
commit833f165d6898355f402697f591cb6960d5dfba5a (patch)
tree712a47ecca8a9acb9638712850fd32c14dac985f /src/or/connection.c
parentc2fa6f5c7d50f467cf2b37a7e95e52e2ce354a6c (diff)
downloadtor-833f165d6898355f402697f591cb6960d5dfba5a.tar
tor-833f165d6898355f402697f591cb6960d5dfba5a.tar.gz
bugfix: make onion proxies actually obey their requested bandwidth
svn:r229
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index e2fc511b0..3a074bce5 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -349,6 +349,7 @@ int connection_read_to_buf(connection_t *conn) {
&conn->inbuf_datalen, &conn->inbuf_reached_eof);
// log(LOG_DEBUG,"connection_read_to_buf(): read_to_buf returned %d.",read_result);
if(read_result >= 0 && connection_speaks_cells(conn)) {
+// log(LOG_DEBUG,"connection_read_to_buf(): Read %d, bucket now %d.",read_result,conn->receiver_bucket);
conn->receiver_bucket -= read_result;
if(conn->receiver_bucket <= 0) {
@@ -477,12 +478,13 @@ int connection_receiver_bucket_should_increase(connection_t *conn) {
return 1;
}
-void connection_increment_receiver_bucket (connection_t *conn) {
+void connection_increment_receiver_bucket(connection_t *conn) {
assert(conn);
if(connection_receiver_bucket_should_increase(conn)) {
/* yes, the receiver_bucket can become overfull here. But not by much. */
conn->receiver_bucket += conn->bandwidth*1.1;
+// log(LOG_DEBUG,"connection_increment_receiver_bucket(): Bucket now %d.",conn->receiver_bucket);
if(connection_state_is_open(conn)) {
/* if we're in state 'open', then start reading again */
connection_start_reading(conn);