Ignore connections two hours after switching from bridge to relay or back.
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)) {
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;