aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2009-06-20 12:59:04 +0200
committerPeter Palfrader <peter@palfrader.org>2009-06-20 12:59:04 +0200
commite4ff67aa0aa9ab32b256a6e9b146e6e9565bb526 (patch)
tree9ab88648a5865fd2e54ca06154578de9720a9082 /src/or/geoip.c
parent6190c8145474d47e00805be9cf1f842437b2d53a (diff)
parentac3dedacce44b306ec1a9372ee54b0aabaeac8fe (diff)
downloadtor-e4ff67aa0aa9ab32b256a6e9b146e6e9565bb526.tar
tor-e4ff67aa0aa9ab32b256a6e9b146e6e9565bb526.tar.gz
Merge commit 'tor-0.2.1.16-rc' into debian-merge
* commit 'tor-0.2.1.16-rc': (31 commits) Bump version to 0.2.1.16-rc prepare changelog for 0.2.1.16-rc Better fix for 997. Revert "Backport fix for bug 997." tor-resolve: Don't automatically refuse .onion addresses. Backport fix for bug 997. Revise earlier check for correct IPv4 addr length to check for ==4. Check answer_len in the remap_addr case of process_relay_cell_not_open. update requirements to openssl 0.9.7 Missing changelog entry about geoip Move and fix a changelog entry. Noticed by optimist. Avoid a memory corruption problem related to "private" in DirPolicy. Update the rest of the geoip file. Update the geoip file Fix gprof bottlenecks on exit nodes found by Jacob. Do not report a node as a "chosen exit" when it is not in fact an exit. Make the second argument to routerset_contains_extendinfo const Don't attempt to log messages to a controller from a worker thread. Clean up a bit of C logic, and fix an erroneous warning. Consider *ListenAddress when warning about low ports and hibernation ...
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 eb0d7e43f..aabbe2688 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;
@@ -386,7 +389,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)
{