]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Move other #9731 check to start of its functions
authorNick Mathewson <nickm@torproject.org>
Thu, 31 Oct 2013 18:10:23 +0000 (14:10 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 31 Oct 2013 18:29:18 +0000 (14:29 -0400)
At arma's suggestion.  Looks like I missed this one.

src/or/connection.c

index 210c6582bb12bedf1cf65e378128ebc71c786d73..1f6e11fac10c76ad0e8204c3e8971f2f6b60ae5b 100644 (file)
@@ -2711,6 +2711,9 @@ connection_consider_empty_write_buckets(connection_t *conn)
 {
   const char *reason;
 
+  if (!connection_is_rate_limited(conn))
+    return; /* Always okay. */
+
   if (global_write_bucket <= 0) {
     reason = "global write bucket exhausted. Pausing.";
   } else if (connection_counts_as_relayed_traffic(conn, approx_time()) &&
@@ -2723,9 +2726,6 @@ 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);