diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-04-28 21:15:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-04-28 21:15:14 -0400 |
commit | f0d9e2d6507adcc069b38cd9e0aaf6702f576314 (patch) | |
tree | f1b92172fbe67fade7a1484316d6f707d8e6d449 /src/or | |
parent | 4010427b519c3727351905bbe5a75e85a055dd58 (diff) | |
parent | 66de6f7eb8e2948f6c3849dbca20c7b31969b5b7 (diff) | |
download | tor-f0d9e2d6507adcc069b38cd9e0aaf6702f576314.tar.gz tor-f0d9e2d6507adcc069b38cd9e0aaf6702f576314.zip |
Merge remote-tracking branch 'arma/bug3012' into maint-0.2.2
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index 7534cc7f69..867182224f 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -5134,6 +5134,11 @@ did_last_state_file_write_fail(void) /** If writing the state to disk fails, try again after this many seconds. */ #define STATE_WRITE_RETRY_INTERVAL 3600 +/** If we're a relay, how often should we checkpoint our state file even + * if nothing else dirties it? This will checkpoint ongoing stats like + * bandwidth used, per-country user stats, etc. */ +#define STATE_RELAY_CHECKPOINT_INTERVAL (12*60*60) + /** Write the persistent state to disk. Return 0 for success, <0 on failure. */ int or_state_save(time_t now) @@ -5186,7 +5191,11 @@ or_state_save(time_t now) tor_free(fname); tor_free(contents); - global_state->next_write = TIME_MAX; + if (server_mode(get_options())) + global_state->next_write = now + STATE_RELAY_CHECKPOINT_INTERVAL; + else + global_state->next_write = TIME_MAX; + return 0; } |