From: Nick Mathewson Date: Fri, 13 Sep 2013 17:37:53 +0000 (-0400) Subject: Don't apply read/write buckets to non-limited connections X-Git-Tag: tor-0.2.5.2-alpha~101^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9205552daab22aaa5178f2abbe169bb79f0cf8e3;p=thirdparty%2Ftor.git Don't apply read/write buckets to non-limited connections Fixes bug 9731 --- diff --git a/changes/bug9731 b/changes/bug9731 new file mode 100644 index 0000000000..11bbc6ab65 --- /dev/null +++ b/changes/bug9731 @@ -0,0 +1,3 @@ + o Major bugfixes: + - Do not apply connection_consider_empty_read/write_buckets to + non-rate-limited connections. diff --git a/src/or/connection.c b/src/or/connection.c index 6e754a0f7a..30ee427e10 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -2483,6 +2483,9 @@ connection_consider_empty_read_buckets(connection_t *conn) } else return; /* all good, no need to stop it */ + if (!connection_is_rate_limited(conn)) + return; /* Always okay. */ + LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason)); conn->read_blocked_on_bw = 1; connection_stop_reading(conn); @@ -2507,6 +2510,9 @@ connection_consider_empty_write_buckets(connection_t *conn) } else return; /* all good, no need to stop it */ + if (!connection_is_rate_limited(conn)) + return; /* Always okay. */ + LOG_FN_CONN(conn, (LOG_DEBUG, LD_NET, "%s", reason)); conn->write_blocked_on_bw = 1; connection_stop_writing(conn);