aboutsummaryrefslogtreecommitdiff
path: root/src/app/config/statefile.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-30 10:29:43 -0400
committerNick Mathewson <nickm@torproject.org>2019-11-07 07:28:43 -0500
commit52c0ab4af3ec152c4b78669acf8877ca27d66097 (patch)
treee8dc14ad0834731fd746bc22d462aae1db18ed3b /src/app/config/statefile.c
parent7ac4f9d5ec1b31a0d4b76ab62c1afc039c8fe627 (diff)
downloadtor-52c0ab4af3ec152c4b78669acf8877ca27d66097.tar.gz
tor-52c0ab4af3ec152c4b78669acf8877ca27d66097.zip
Add subsys functions for receiving/flushing states and options.
These functions are in the subsystem, not in the config_format_t, since they are about how the format is _used_, not about _what it is_.
Diffstat (limited to 'src/app/config/statefile.c')
-rw-r--r--src/app/config/statefile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c
index f6b0915da4..5fdb15ace1 100644
--- a/src/app/config/statefile.c
+++ b/src/app/config/statefile.c
@@ -316,6 +316,9 @@ or_state_set(or_state_t *new_state)
tor_assert(new_state);
config_free(get_state_mgr(), global_state);
global_state = new_state;
+ if (subsystems_set_state(get_state_mgr(), global_state) < 0) {
+ ret = -1;
+ }
if (entry_guards_parse_state(global_state, 1, &err)<0) {
log_warn(LD_GENERAL,"%s",err);
tor_free(err);
@@ -519,6 +522,7 @@ or_state_save(time_t now)
/* Call everything else that might dirty the state even more, in order
* to avoid redundant writes. */
+ (void) subsystems_flush_state(get_state_mgr(), global_state);
entry_guards_update_state(global_state);
rep_hist_update_state(global_state);
circuit_build_times_update_state(get_circuit_build_times(), global_state);