diff options
author | Roger Dingledine <arma@torproject.org> | 2007-12-19 04:58:58 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-12-19 04:58:58 +0000 |
commit | f405f9b6140d9f001bb96364dc4c240afc222103 (patch) | |
tree | 8c16b2430bf2e4b0a19e010d640cb0291db17152 /src/or/main.c | |
parent | a697573ce911f0b16e5cb5e8d73d4863883f82ac (diff) | |
download | tor-f405f9b6140d9f001bb96364dc4c240afc222103.tar.gz tor-f405f9b6140d9f001bb96364dc4c240afc222103.zip |
Make getinfo ns/purpose/bridge actually work
Also, dump our bridge router status entries to disk every 30 minutes.
svn:r12871
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c index 620edad426..e00a03ac83 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -119,8 +119,6 @@ int has_completed_circuit=0; /** How long do we let OR connections handshake before we decide that * they are obsolete? */ #define TLS_HANDSHAKE_TIMEOUT (60) -/** How often do we write hidden service usage statistics to disk? */ -#define WRITE_HSUSAGE_INTERVAL (900) /********* END VARIABLES ************/ @@ -830,7 +828,10 @@ run_scheduled_events(time_t now) static time_t time_to_try_getting_descriptors = 0; static time_t time_to_reset_descriptor_failures = 0; static time_t time_to_add_entropy = 0; +#define WRITE_HSUSAGE_INTERVAL (30*60) static time_t time_to_write_hs_statistics = 0; +#define BRIDGE_STATUSFILE_INTERVAL (30*60) + static time_t time_to_write_bridge_status_file = 0; static time_t time_to_downrate_stability = 0; #define SAVE_STABILITY_INTERVAL (30*60) static time_t time_to_save_stability = 0; @@ -1111,6 +1112,12 @@ run_scheduled_events(time_t now) hs_usage_write_statistics_to_file(now); time_to_write_hs_statistics = now+WRITE_HSUSAGE_INTERVAL; } + /** 10b. write bridge networkstatus file to disk */ + if (options->BridgeAuthoritativeDir && + time_to_write_bridge_status_file < now) { + hs_usage_write_statistics_to_file(now); + time_to_write_bridge_status_file = now+BRIDGE_STATUSFILE_INTERVAL; + } } /** Libevent timer: used to invoke second_elapsed_callback() once per |