diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-04-28 21:17:51 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-04-28 21:17:51 -0400 |
commit | 20d6ac3530553bfc139a33d80248b2ffc9c3d7eb (patch) | |
tree | 25d92213822aba79a2af5ec38f25cff4673ce73c /src/or/config.c | |
parent | b0a7e0d6ca45bef3c5836d9082dcc9461cee6c9c (diff) | |
parent | f0d9e2d6507adcc069b38cd9e0aaf6702f576314 (diff) | |
download | tor-20d6ac3530553bfc139a33d80248b2ffc9c3d7eb.tar tor-20d6ac3530553bfc139a33d80248b2ffc9c3d7eb.tar.gz |
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or/config.c')
-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 ead08d5e8..a4d3e34d8 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -5300,6 +5300,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) @@ -5352,7 +5357,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; } |