summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-03-04 00:43:20 -0500
committerRoger Dingledine <arma@torproject.org>2011-03-04 00:43:20 -0500
commitb3820e0d03b1b54575c1b5d946180581e281798d (patch)
treed617eb98fa6dba7a683df508794b1114157256b7
parent17f873a20b2bf7be66382378e0c4d43d8a27c041 (diff)
parent1d6af67ab8d96c30e022f1f7602276f10c8444dc (diff)
downloadtor-b3820e0d03b1b54575c1b5d946180581e281798d.tar.gz
tor-b3820e0d03b1b54575c1b5d946180581e281798d.zip
Merge branch 'maint-0.2.2' into release-0.2.2
-rw-r--r--doc/tor.1.txt2
-rw-r--r--src/or/rephist.c12
2 files changed, 10 insertions, 4 deletions
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 8b8fd202bf..f1734d2016 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -34,7 +34,7 @@ OPTIONS
Display a short help message and exit.
**-f** __FILE__::
- FILE contains further "option value" paris. (Default: @CONFDIR@/torrc)
+ FILE contains further "option value" pairs. (Default: @CONFDIR@/torrc)
**--hash-password**::
Generates a hashed password for control port access.
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 3f4a70418b..61ae2c317e 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1602,18 +1602,24 @@ rep_hist_load_bwhist_state_section(bw_array_t *b,
b->cur_obs_time = start;
b->next_period = start + NUM_SECS_BW_SUM_INTERVAL;
SMARTLIST_FOREACH_BEGIN(s_values, const char *, cp) {
+ const char *maxstr = NULL;
v = tor_parse_uint64(cp, 10, 0, UINT64_MAX, &ok, NULL);
if (have_maxima) {
- const char *maxstr = smartlist_get(s_maxima, cp_sl_idx);
+ maxstr = smartlist_get(s_maxima, cp_sl_idx);
mv = tor_parse_uint64(maxstr, 10, 0, UINT64_MAX, &ok_m, NULL);
mv *= NUM_SECS_ROLLING_MEASURE;
} else {
/* No maxima known; guess average rate to be conservative. */
mv = v / s_interval;
}
- if (!ok || !ok_m) {
+ if (!ok) {
retval = -1;
- log_notice(LD_HIST, "Could not parse '%s' into a number.'", cp);
+ log_notice(LD_HIST, "Could not parse value '%s' into a number.'",cp);
+ }
+ if (maxstr && !ok_m) {
+ retval = -1;
+ log_notice(LD_HIST, "Could not parse maximum '%s' into a number.'",
+ maxstr);
}
if (start < now) {