]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
When our bridge status changes, forget old geoip data.
authorNick Mathewson <nickm@torproject.org>
Tue, 12 May 2009 19:35:53 +0000 (15:35 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 13 May 2009 20:45:59 +0000 (16:45 -0400)
This fixes bug 932, where all of our usage totals for users when we
were a regular server would get included in the extrainfo document.

src/or/config.c

index 71dd391664dcbb423cfc6e007469d32a0afa56a8..3d757c1bbb66dd00223c51806bb321b173b7248a 100644 (file)
@@ -1329,6 +1329,11 @@ options_act(or_options_t *old_options)
       circuit_expire_all_dirty_circs();
     }
 
+    if (! bool_eq(options->BridgeRelay, old_options->BridgeRelay)) {
+      log_info(LD_GENERAL, "Bridge status changed.  Forgetting GeoIP stats.");
+      geoip_remove_old_clients(time(NULL)+3600);
+    }
+
     if (options_transition_affects_workers(old_options, options)) {
       log_info(LD_GENERAL,
                "Worker-related options changed. Rotating workers.");