summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2013-01-30 17:51:37 -0400
committerNick Mathewson <nickm@torproject.org>2013-02-01 17:01:12 -0500
commit2b2c7f23f5b36ee01540d40acae1230b38aa66a0 (patch)
treefb09cf7ccffda3934db81288282e30d1b7e9b1f1
parent6828a19670080a3d19bdddf1e55d53928d81a410 (diff)
downloadtor-2b2c7f23f5b36ee01540d40acae1230b38aa66a0.tar.gz
tor-2b2c7f23f5b36ee01540d40acae1230b38aa66a0.zip
Mark entry guard state dirty everwhere the pathbias code touches it.
-rw-r--r--src/or/circuitbuild.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index ddc11d0e35..958e4102ab 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1539,6 +1539,7 @@ pathbias_count_build_success(origin_circuit_t *circ)
if (circ->path_state == PATH_STATE_BUILD_ATTEMPTED) {
circ->path_state = PATH_STATE_BUILD_SUCCEEDED;
guard->circ_successes++;
+ entry_guards_changed();
log_info(LD_CIRC, "Got success count %f/%f for guard %s=%s",
guard->circ_successes, guard->circ_attempts,
@@ -1623,6 +1624,7 @@ pathbias_count_use_attempt(origin_circuit_t *circ)
if (guard) {
pathbias_check_use_rate(guard);
guard->use_attempts++;
+ entry_guards_changed();
log_debug(LD_CIRC,
"Marked circuit %d (%f/%f) as used for guard %s=%s.",
@@ -1706,6 +1708,7 @@ pathbias_count_use_success(origin_circuit_t *circ)
circ->cpath->extend_info->identity_digest);
if (guard) {
guard->use_successes++;
+ entry_guards_changed();
log_debug(LD_CIRC,
"Marked circuit %d (%f/%f) as used successfully for guard "
@@ -2244,6 +2247,7 @@ pathbias_check_use_rate(entry_guard_t *guard)
tor_lround(circ_times.close_ms/1000));
guard->path_bias_disabled = 1;
guard->bad_since = approx_time();
+ entry_guards_changed();
return -1;
}
} else if (!guard->path_bias_extreme) {
@@ -2315,6 +2319,7 @@ pathbias_check_use_rate(entry_guard_t *guard)
"Scaled pathbias use counts to %f/%f (%d open) for guard %s=%s",
guard->use_successes, guard->use_attempts, opened_attempts,
guard->nickname, hex_str(guard->identity, DIGEST_LEN));
+ entry_guards_changed();
}
return 0;
@@ -2366,6 +2371,7 @@ pathbias_check_close_rate(entry_guard_t *guard)
tor_lround(circ_times.close_ms/1000));
guard->path_bias_disabled = 1;
guard->bad_since = approx_time();
+ entry_guards_changed();
return -1;
}
} else if (!guard->path_bias_extreme) {
@@ -2470,6 +2476,8 @@ pathbias_check_close_rate(entry_guard_t *guard)
guard->circ_attempts += opened_attempts;
guard->circ_successes += opened_built;
+ entry_guards_changed();
+
log_info(LD_CIRC,
"Scaled pathbias counts to (%f,%f)/%f (%d/%d open) for guard "
"%s=%s",