aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-31 14:10:23 -0400
committerNick Mathewson <nickm@torproject.org>2013-10-31 14:10:23 -0400
commit96f92f2062118b61a43134170b92001d3be1c128 (patch)
tree8c6538edf67c179bc1ba861fa2999c35407c0966
parent702c0502cf3121e2e698963cf53adb00ae2d136d (diff)
downloadtor-96f92f2062118b61a43134170b92001d3be1c128.tar
tor-96f92f2062118b61a43134170b92001d3be1c128.tar.gz
Move #9731 checks to start of their functions
At arma's suggestion.
-rw-r--r--src/or/connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 43ec43f43..210c6582b 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2684,6 +2684,9 @@ connection_consider_empty_read_buckets(connection_t *conn)
{
const char *reason;
+ if (!connection_is_rate_limited(conn))
+ return; /* Always okay. */
+
if (global_read_bucket <= 0) {
reason = "global read bucket exhausted. Pausing.";
} else if (connection_counts_as_relayed_traffic(conn, approx_time()) &&
@@ -2696,9 +2699,6 @@ 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);