aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-05-27 14:20:18 -0400
committerNick Mathewson <nickm@torproject.org>2009-05-27 14:20:18 -0400
commit0e2618dd549701e0cede8e2b631f13b8f4071e8e (patch)
tree07d4d5eeb84b1acd92398303254b2439f4bd014b /src/or/geoip.c
parent181674e9bba9f4a0155f6172e437931d9560219c (diff)
parent1843f3936c7ee834a5974d1914bf749f8ea27e39 (diff)
downloadtor-0e2618dd549701e0cede8e2b631f13b8f4071e8e.tar.gz
tor-0e2618dd549701e0cede8e2b631f13b8f4071e8e.zip
Merge commit 'origin/maint-0.2.1'
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 64ced6ea90..41c8f21cdb 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -310,6 +310,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;
@@ -393,7 +396,10 @@ _remove_old_client_helper(struct clientmap_entry_t *ent, void *_cutoff)
}
}
-/** Forget about all clients that haven't connected since <b>cutoff</b>. */
+/** Forget about all clients that haven't connected since <b>cutoff</b>.
+ * If <b>cutoff</b> 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)
{