]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
squash! Remove a source of error during path bias scaling
authorMike Perry <mikeperry-git@fscked.org>
Sun, 20 Jan 2013 03:56:52 +0000 (19:56 -0800)
committerMike Perry <mikeperry-git@fscked.org>
Sun, 20 Jan 2013 22:32:27 +0000 (14:32 -0800)
Move a log message about scaling to after we scale

src/or/circuitbuild.c

index 8c7bd87ca551ce230dfc1a9e7fc9cc7d7a9761ea..105e1acf4a0f636f994a43b9ff800fa8cf53bfd3 100644 (file)
@@ -2244,12 +2244,6 @@ pathbias_check_use_rate(entry_guard_t *guard)
             PATH_STATE_USE_ATTEMPTED, PATH_STATE_USE_ATTEMPTED);
     guard->use_attempts -= opened_attempts;
 
-    log_info(LD_CIRC,
-             "Scaling pathbias use counts to (%f/%f)*(%d/%d) for guard %s=%s",
-             guard->use_successes, guard->use_attempts,
-             mult_factor, scale_factor, guard->nickname,
-             hex_str(guard->identity, DIGEST_LEN));
-
     guard->use_attempts *= mult_factor;
     guard->use_successes *= mult_factor;
 
@@ -2257,6 +2251,11 @@ pathbias_check_use_rate(entry_guard_t *guard)
     guard->use_successes /= scale_factor;
 
     guard->use_attempts += opened_attempts;
+
+    log_info(LD_CIRC,
+             "Scaled pathbias use counts to %f/%f for guard %s=%s",
+             guard->use_successes, guard->use_attempts,
+             guard->nickname, hex_str(guard->identity, DIGEST_LEN));
   }
 
   return 0;
@@ -2394,11 +2393,6 @@ pathbias_check_close_rate(entry_guard_t *guard)
                         PATH_STATE_USE_FAILED);
     guard->circ_attempts -= opened_attempts;
     guard->circ_successes -= opened_built;
-    log_info(LD_CIRC,
-             "Scaling pathbias counts to (%f/%f)*(%d/%d) for guard %s=%s",
-             guard->circ_successes, guard->circ_attempts,
-             mult_factor, scale_factor, guard->nickname,
-             hex_str(guard->identity, DIGEST_LEN));
 
     guard->circ_attempts *= mult_factor;
     guard->circ_successes *= mult_factor;
@@ -2416,6 +2410,12 @@ pathbias_check_close_rate(entry_guard_t *guard)
 
     guard->circ_attempts += opened_attempts;
     guard->circ_successes += opened_built;
+
+    log_info(LD_CIRC,
+             "Scaled pathbias counts to (%f,%f)/%f for guard %s=%s",
+             guard->circ_successes, guard->successful_circuits_closed,
+             guard->circ_attempts, guard->nickname,
+             hex_str(guard->identity, DIGEST_LEN));
   }
 
   return 0;