[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master 1/2] Fix a bug in reading CircPriorityHalflife from consensus



Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon, 12 Apr 2010 15:38:54 -0400
Subject: Fix a bug in reading CircPriorityHalflife from consensus
Commit: d888a8210fc33d9d0ad835c05a2bf8b7b6882830

When you mean (a=b(c,d)) >= 0, you had better not say (a=b(c,d)>=0).
We did the latter, and so whenever CircPriorityHalflife was in the
consensus, it was treated as having a value of 1 msec (that is,
boolean true).
---
 changes/read_circpriorityhalflife_correctly |    5 +++++
 src/or/relay.c                              |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)
 create mode 100644 changes/read_circpriorityhalflife_correctly

diff --git a/changes/read_circpriorityhalflife_correctly b/changes/read_circpriorityhalflife_correctly
new file mode 100644
index 0000000..9fcbd69
--- /dev/null
+++ b/changes/read_circpriorityhalflife_correctly
@@ -0,0 +1,5 @@
+ o Major bugfixes:
+   - Fix a stupid parenthesization error that made every possible value
+     of CircPriorityHalflifeMsec get treated as "1 msec".  Bugfix on
+     0.2.2.7-alpha.
+
diff --git a/src/or/relay.c b/src/or/relay.c
index 599d3d9..c417cbe 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1865,7 +1865,7 @@ cell_ewma_set_scale_factor(or_options_t *options, networkstatus_t *consensus)
     source = "CircuitPriorityHalflife in configuration";
   } else if (consensus &&
              (halflife_ms = networkstatus_get_param(
-                   consensus, "CircPriorityHalflifeMsec", -1) >= 0)) {
+                   consensus, "CircPriorityHalflifeMsec", -1)) >= 0) {
     halflife = ((double)halflife_ms)/1000.0;
     source = "CircPriorityHalflifeMsec in consensus";
   } else {
-- 
1.6.5