From 031ce86cd4615c29c42a9c8dc344ab819ac91978 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 May 2009 12:10:37 -0400 Subject: Add *.swp to .gitignore as vim's editor dropping. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f5d2d4ee9..46917c311 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ \#*\# .#* *~ +*.swp # C stuff *.o # Diff droppings -- cgit v1.2.3 From 5f03d6c547629af73dea2cfdaf888bc3a7caab5d Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Tue, 26 May 2009 21:41:42 +0200 Subject: Fix bug 932 even more. Ignore connections two hours after switching from bridge to relay or back. --- src/or/config.c | 2 +- src/or/geoip.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/or/config.c b/src/or/config.c index 25364b6a3..6030849a1 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1331,7 +1331,7 @@ options_act(or_options_t *old_options) 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); + geoip_remove_old_clients(time(NULL)+(2*60*60)); } if (options_transition_affects_workers(old_options, options)) { diff --git a/src/or/geoip.c b/src/or/geoip.c index eb0d7e43f..e1477d4ea 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -308,6 +308,9 @@ geoip_note_client_seen(geoip_client_action_t action, if (action == GEOIP_CLIENT_CONNECT) { if (!(options->BridgeRelay && options->BridgeRecordUsageByCountry)) return; + /* Did we recently switch from bridge to relay or back? */ + if (client_history_starts > now) + return; } else { #ifndef ENABLE_GEOIP_STATS return; -- cgit v1.2.3 From 02a417d4e0dee629a0026b726d108fda7c9a0884 Mon Sep 17 00:00:00 2001 From: Karsten Loesing Date: Tue, 26 May 2009 22:02:52 +0200 Subject: Improve documentation for the last fix of bug 932. --- src/or/geoip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/or/geoip.c b/src/or/geoip.c index e1477d4ea..aabbe2688 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -389,7 +389,10 @@ _remove_old_client_helper(struct clientmap_entry_t *ent, void *_cutoff) } } -/** Forget about all clients that haven't connected since cutoff. */ +/** Forget about all clients that haven't connected since cutoff. + * If cutoff is in the future, clients won't be added to the history + * until this time is reached. This is useful to prevent relays that switch + * to bridges from reporting unbelievable numbers of clients. */ void geoip_remove_old_clients(time_t cutoff) { -- cgit v1.2.3 From 1843f3936c7ee834a5974d1914bf749f8ea27e39 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 May 2009 14:11:38 -0400 Subject: Changelog entry for Karsten's bug-932 patch. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2de570dbb..ef12f4385 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ Changes in version 0.2.1.16-?? - 2009-??-?? - Log correct error messages for DNS-related network errors on Windows. + o Minor bugfixes (on 0.2.1.x): + - When switching back and forth between bridge mode, do not start + gathering GeoIP data until two hours have passed. + Changes in version 0.2.1.15-rc - 2009-05-25 o Major bugfixes (on 0.2.0.x): -- cgit v1.2.3