diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-07-08 14:29:04 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2010-08-05 13:05:32 +0200 |
commit | d365bc965d127e244528b6d15b818d87397724d0 (patch) | |
tree | 2f50672b91e5d95110d13cf47bf5e89ea5bb430c /src/or/config.c | |
parent | 166c2f4d92e0d1f55a6141acb076b10ad356f285 (diff) | |
download | tor-d365bc965d127e244528b6d15b818d87397724d0.tar.gz tor-d365bc965d127e244528b6d15b818d87397724d0.zip |
Only delay counting bridge users if we were a relay before
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index 4c9ab6525e..1a89268006 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1245,11 +1245,24 @@ options_act(or_options_t *old_options) circuit_expire_all_dirty_circs(); } +/* How long should we delay counting bridge stats after becoming a bridge? + * We use this so we don't count people who used our bridge thinking it is + * a relay. If you change this, don't forget to change the log message + * below. */ +#define RELAY_BRIDGE_STATS_DELAY (2 * 60 * 60) + if (! bool_eq(options->BridgeRelay, old_options->BridgeRelay)) { + int was_relay = 0; if (options->BridgeRelay) { - geoip_bridge_stats_init(time(NULL) + (2 * 60 * 60)); + time_t int_start = time(NULL); + if (old_options->ORPort == options->ORPort) { + int_start += RELAY_BRIDGE_STATS_DELAY; + was_relay = 1; + } + geoip_bridge_stats_init(int_start); log_info(LD_CONFIG, "We are acting as a bridge now. Starting new " - "GeoIP stats interval in 2 hours from now."); + "GeoIP stats interval%s.", was_relay ? " in 2 " + "hours from now" : ""); } else { geoip_bridge_stats_term(); log_info(LD_GENERAL, "We are no longer acting as a bridge. " |