diff options
author | Adam <Adam@anope.org> | 2014-05-20 21:10:49 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-05-20 21:16:00 -0400 |
commit | 866f3f32ab3713e9867747f150df3698e456744e (patch) | |
tree | 20aabb18d88ee72a4fd412e17ebe30585496bd97 /modules/m_proxyscan.cpp | |
parent | 20ce170024779aebbc1462146905c976836a552f (diff) |
Speed up akill xline checks
Cache xline nick, user, host, etc instead of rebuilding it everytime its
requested. Store users ip in sockaddr form and not string form to
prevent having to rebuild sockaddrs when checking xlines.
Also do not try to convert empty config values in Config::Get as this
can be rather common if a non string configuration value is not set, and
the cost of the ConvertException is great.
Diffstat (limited to 'modules/m_proxyscan.cpp')
-rw-r--r-- | modules/m_proxyscan.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/m_proxyscan.cpp b/modules/m_proxyscan.cpp index 0fe4ade27..6df764166 100644 --- a/modules/m_proxyscan.cpp +++ b/modules/m_proxyscan.cpp @@ -334,9 +334,7 @@ class ModuleProxyScan : public Module return; /* At this time we only support IPv4 */ - sockaddrs user_ip; - user_ip.pton(AF_INET, user->ip); - if (!user_ip.valid()) + if (!user->ip.valid() || user->ip.sa.sa_family != AF_INET) /* User doesn't have a valid IPv4 IP (ipv6/spoof/etc) */ return; @@ -364,7 +362,7 @@ class ModuleProxyScan : public Module con = new SOCKS5ProxyConnect(p, p.ports[k]); else continue; - con->Connect(user->ip, p.ports[k]); + con->Connect(user->ip.addr(), p.ports[k]); } catch (const SocketException &ex) { |