aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-04-24 22:05:41 -0400
committerNick Mathewson <nickm@torproject.org>2013-04-24 22:05:41 -0400
commit68ea7d24d8e1ceb594ae5a63a3d433bd78a079cd (patch)
tree9267c60b7fea523c8c217c87ec327900a4cf186d
parent6e89d29bd5ee93b87ab0ce97e46408d196d0f6d4 (diff)
parentcab5f82d125d721fa4b73568323ac1b6009002c3 (diff)
downloadtor-68ea7d24d8e1ceb594ae5a63a3d433bd78a079cd.tar
tor-68ea7d24d8e1ceb594ae5a63a3d433bd78a079cd.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.4'
-rw-r--r--changes/bug8253-fix6
-rw-r--r--src/or/circuitbuild.c4
-rw-r--r--src/or/entrynodes.c4
3 files changed, 10 insertions, 4 deletions
diff --git a/changes/bug8253-fix b/changes/bug8253-fix
new file mode 100644
index 000000000..3d36d06c8
--- /dev/null
+++ b/changes/bug8253-fix
@@ -0,0 +1,6 @@
+ o Minor bugfixes (log messages)
+ - Fix a scaling issue in the path bias accounting code that resulted in
+ "Bug:" log messages from either pathbias_scale_close_rates() or
+ pathbias_count_build_success(). This represents a bugfix on a previous
+ bugfix: The original fix attempted in 0.2.4.10-alpha was incomplete.
+ Fixes bug 8235; bugfix on 0.2.4.1-alpha.
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 31242f6c1..43d2ffe4d 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2491,7 +2491,7 @@ pathbias_scale_close_rates(entry_guard_t *guard)
/* Verify that the counts are sane before and after scaling */
int counts_are_sane = (guard->circ_attempts >= guard->circ_successes);
- guard->circ_attempts -= opened_attempts;
+ guard->circ_attempts -= (opened_attempts+opened_built);
guard->circ_successes -= opened_built;
guard->circ_attempts *= scale_ratio;
@@ -2501,7 +2501,7 @@ pathbias_scale_close_rates(entry_guard_t *guard)
guard->collapsed_circuits *= scale_ratio;
guard->unusable_circuits *= scale_ratio;
- guard->circ_attempts += opened_attempts;
+ guard->circ_attempts += (opened_attempts+opened_built);
guard->circ_successes += opened_built;
entry_guards_changed();
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 086561a9c..70f7c878e 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -1219,7 +1219,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
int severity = LOG_INFO;
/* If this state file was written by a Tor that would have
* already fixed it, then the overcounting bug is still there.. */
- if (tor_version_as_new_as(state_version, "0.2.4.12-alpha")) {
+ if (tor_version_as_new_as(state_version, "0.2.4.13-alpha")) {
severity = LOG_NOTICE;
}
log_fn(severity, LD_BUG,
@@ -1284,7 +1284,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
int severity = LOG_INFO;
/* If this state file was written by a Tor that would have
* already fixed it, then the overcounting bug is still there.. */
- if (tor_version_as_new_as(state_version, "0.2.4.12-alpha")) {
+ if (tor_version_as_new_as(state_version, "0.2.4.13-alpha")) {
severity = LOG_NOTICE;
}
log_fn(severity, LD_BUG,