diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-12-24 02:45:46 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-12-24 02:45:46 +0000 |
commit | bba5a3533f1413601c04a8f61ab0662b77fe7e2b (patch) | |
tree | 906f5a9e23837b5b7f718d20415802aa8b90494a /src/or/circuitbuild.c | |
parent | a9dc42e3815ff49f469d37039df83fb2db6fa73e (diff) | |
download | tor-bba5a3533f1413601c04a8f61ab0662b77fe7e2b.tar.gz tor-bba5a3533f1413601c04a8f61ab0662b77fe7e2b.zip |
r11679@Kushana: nickm | 2006-12-23 21:38:41 -0500
Update the state file less often when AvoidDiskWrites is set.
svn:r9174
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 5de96f670e..38135fb476 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2412,10 +2412,12 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg) static void entry_guards_changed(void) { + time_t when; entry_guards_dirty = 1; /* or_state_save() will call entry_guards_update_state(). */ - or_state_mark_dirty(get_or_state(), time(NULL)+600); + when = get_options()->AvoidDiskWrites ? time(NULL) + 3600 : time(NULL)+600; + or_state_mark_dirty(get_or_state(), when); } /** If the entry guard info has not changed, do nothing and return. @@ -2466,7 +2468,8 @@ entry_guards_update_state(or_state_t *state) next = &(line->next); } }); - or_state_mark_dirty(get_or_state(), 0); + if (!get_options()->AvoidDiskWrites) + or_state_mark_dirty(get_or_state(), 0); entry_guards_dirty = 0; } |