From 63e4cfbeb609f88bdcc622b63cc74558a6e0e235 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 7 Dec 2006 18:57:29 +0000 Subject: r11461@Kushana: nickm | 2006-12-07 13:16:45 -0500 Change logging format of state file to only include non-default values. Adjust clients to never store bandwidth history in the state file. (Possible backport candidate.) svn:r9043 --- src/or/rephist.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/or/rephist.c') diff --git a/src/or/rephist.c b/src/or/rephist.c index 0e0530abbc..20b76679bd 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -659,12 +659,20 @@ rep_hist_update_state(or_state_t *state) s_interval= r?&state->BWHistoryReadInterval:&state->BWHistoryWriteInterval; s_values = r?&state->BWHistoryReadValues :&state->BWHistoryWriteValues; - *s_begins = b->next_period; - *s_interval = NUM_SECS_BW_SUM_INTERVAL; if (*s_values) { SMARTLIST_FOREACH(*s_values, char *, cp, tor_free(cp)); smartlist_free(*s_values); } + if (! server_mode(get_options())) { + /* Clients don't need to store bandwidth history persistently; + * force these values to the defaults. */ + *s_begins = 0; + *s_interval = 900; + *s_values = smartlist_create(); + continue; + } + *s_begins = b->next_period; + *s_interval = NUM_SECS_BW_SUM_INTERVAL; cp = buf; cp += rep_hist_fill_bandwidth_history(cp, len, b); tor_snprintf(cp, len-(cp-buf), cp == buf ? U64_FORMAT : ","U64_FORMAT, -- cgit v1.2.3-54-g00ecf