summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-01 17:15:37 -0500
committerNick Mathewson <nickm@torproject.org>2011-03-01 17:15:37 -0500
commitd60a7c2f8d139d2b2dfd71780dae8a86489cec49 (patch)
tree187ca7eb6ecba512dc554f8f942acedaa81e9b8d /src/or/rephist.c
parent42c1a47123cd6752435dd039e88c5760f7e18085 (diff)
parent6b7408178bf9cb3864cec14408d78e8374f26b68 (diff)
downloadtor-d60a7c2f8d139d2b2dfd71780dae8a86489cec49.tar.gz
tor-d60a7c2f8d139d2b2dfd71780dae8a86489cec49.zip
Merge remote branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index f34c5b6dd1..0c5f937ffb 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1607,18 +1607,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) {