Browse Source

Don't do GeoIP lookups for remote users. These are already looked up and

synced by the server the user is on, and this way the country will be
consistently the same on all servers (and not BE on one, and NL on another,
which would be confusing for the ban matching code, giving different
results on each server).
pull/41/head
Bram Matthys 11 months ago
parent
commit
bd05cdf779
No known key found for this signature in database
GPG Key ID: BF8116B163EAAE98
  1. 12
      src/modules/geoip_base.c

12
src/modules/geoip_base.c

@ -122,7 +122,6 @@ MOD_INIT()
HookAdd(modinfo->handle, HOOKTYPE_SERVER_HANDSHAKE_OUT, 0, geoip_base_handshake);
HookAdd(modinfo->handle, HOOKTYPE_CONNECT_EXTINFO, 1, geoip_connect_extinfo); /* (prio: near-first) */
HookAdd(modinfo->handle, HOOKTYPE_PRE_LOCAL_CONNECT, 0,geoip_base_handshake); /* in case the IP changed in registration phase (WEBIRC, HTTP Forwarded) */
HookAdd(modinfo->handle, HOOKTYPE_REMOTE_CONNECT, 0, geoip_base_handshake); /* remote user */
HookAdd(modinfo->handle, HOOKTYPE_WHOIS, 0, geoip_base_whois);
CommandAdd(modinfo->handle, "GEOIP", cmd_geoip, MAXPARA, CMD_USER);
@ -229,12 +228,13 @@ void geoip_base_unserialize(const char *str, ModData *m)
m->ptr = res;
}
EVENT(geoip_base_set_existing_users_evt){
EVENT(geoip_base_set_existing_users_evt)
{
Client *client;
list_for_each_entry(client, &client_list, client_node){
if (!IsUser(client))
continue;
geoip_base_handshake(client);
list_for_each_entry(client, &client_list, client_node)
{
if (MyUser(client))
geoip_base_handshake(client);
}
}

Loading…
Cancel
Save