[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tor-cvs
Subject:    [tor-commits] [tor/master] Move #9731 checks to start of their functions
From:       nickm () torproject ! org
Date:       2013-10-31 18:10:38
Message-ID: 20131031181038.33979224E4 () cupani ! torproject ! org
[Download RAW message or body]

commit 96f92f2062118b61a43134170b92001d3be1c128
Author: Nick Mathewson <nickm@torproject.org>
Date:   Thu Oct 31 14:10:23 2013 -0400

    Move #9731 checks to start of their functions
    
    At arma's suggestion.
---
 src/or/connection.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 43ec43f..210c658 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);

_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic