correction and cleanups on r9047

svn:r9060
This commit is contained in:
Roger Dingledine
2006-12-09 19:40:16 +00:00
parent 32f37b3fb0
commit f7319a0b6d
4 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -2377,7 +2377,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
/** Our list of entry guards has changed, or some element of one
* of our entry guards has changed. Write the changes to disk within
* the next 5 minutes.
* the next few minutes.
*/
static void
entry_guards_changed(void)
+1 -1
View File
@@ -577,7 +577,7 @@ accounting_record_bandwidth_usage(time_t now, or_state_t *state)
ROUND_UP(n_bytes_written_in_interval);
state->AccountingSecondsActive = n_seconds_active_in_interval;
state->AccountingExpectedUsage = expected_bandwidth_usage;
or_state_mark_dirty(state, 60);
or_state_mark_dirty(state, now+60);
return r;
}
+3 -4
View File
@@ -1663,7 +1663,7 @@ typedef struct {
/** When was the state last written to disk? */
time_t LastWritten;
/** Fields for */
/** Fields for accounting bandwidth use. */
time_t AccountingIntervalStart;
uint64_t AccountingBytesReadInInterval;
uint64_t AccountingBytesWrittenInInterval;
@@ -1686,15 +1686,14 @@ typedef struct {
int BWHistoryWriteInterval;
smartlist_t *BWHistoryWriteValues;
/** What version of Tor write this state file? */
/** What version of Tor wrote this state file? */
char *TorVersion;
/** holds any unrecognized values we found in the state file, in the order
/** Holds any unrecognized values we found in the state file, in the order
* in which we found them. */
config_line_t *ExtraLines;
} or_state_t;
static void or_state_mark_dirty(or_state_t *state, time_t when);
/** Change the next_write time of <b>state</b> to <b>when</b>, unless the
* state is already scheduled to be written to disk earlier than <b>when</b>.
*/
+2
View File
@@ -667,6 +667,8 @@ rep_hist_update_state(or_state_t *state)
if (! server_mode(get_options())) {
/* Clients don't need to store bandwidth history persistently;
* force these values to the defaults. */
/* FFFF we should pull the default out of config.c's state table,
* so we don't have two defaults. */
if (*s_begins != 0 || *s_interval != 900)
or_state_mark_dirty(get_or_state(), time(NULL)+600);
*s_begins = 0;