aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2013-01-20 14:30:02 -0800
committerMike Perry <mikeperry-git@fscked.org>2013-01-20 14:32:56 -0800
commitb810d322bfc55d202dbbd2e8ebe4529cf0778c8b (patch)
treed9e174860d17212cf097b9665ee0dfdb82b23b76 /src/or/circuitbuild.c
parent06a1d0b0447d3766b6199135f6878c6ce047f3b1 (diff)
downloadtor-b810d322bfc55d202dbbd2e8ebe4529cf0778c8b.tar
tor-b810d322bfc55d202dbbd2e8ebe4529cf0778c8b.tar.gz
squash! Remove a source of error during path bias scaling
Improve debug logs and fix a state fencepost error.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index a4c67cfff..97a26dd30 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2105,6 +2105,9 @@ pathbias_count_circs_in_states(entry_guard_t *guard,
fast_memeq(guard->identity,
ocirc->cpath->extend_info->identity_digest,
DIGEST_LEN)) {
+ log_debug(LD_CIRC, "Found opened circuit %d in path_state %s",
+ ocirc->global_identifier,
+ pathbias_state_to_string(ocirc->path_state));
open_circuits++;
}
}
@@ -2245,7 +2248,7 @@ pathbias_check_use_rate(entry_guard_t *guard)
const int scale_factor = pathbias_get_scale_factor(options);
const int mult_factor = pathbias_get_mult_factor(options);
int opened_attempts = pathbias_count_circs_in_states(guard,
- PATH_STATE_USE_ATTEMPTED, PATH_STATE_USE_ATTEMPTED);
+ PATH_STATE_USE_ATTEMPTED, PATH_STATE_USE_SUCCEEDED);
guard->use_attempts -= opened_attempts;
guard->use_attempts *= mult_factor;
@@ -2257,8 +2260,8 @@ pathbias_check_use_rate(entry_guard_t *guard)
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,
+ "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));
}
@@ -2416,10 +2419,11 @@ pathbias_check_close_rate(entry_guard_t *guard)
guard->circ_successes += opened_built;
log_info(LD_CIRC,
- "Scaled pathbias counts to (%f,%f)/%f for guard %s=%s",
+ "Scaled pathbias counts to (%f,%f)/%f (%d/%d open) for guard "
+ "%s=%s",
guard->circ_successes, guard->successful_circuits_closed,
- guard->circ_attempts, guard->nickname,
- hex_str(guard->identity, DIGEST_LEN));
+ guard->circ_attempts, opened_built, opened_attempts,
+ guard->nickname, hex_str(guard->identity, DIGEST_LEN));
}
return 0;