summaryrefslogtreecommitdiff
path: root/include/sockets.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-05-20 21:10:49 -0400
committerAdam <Adam@anope.org>2014-05-20 21:16:00 -0400
commit866f3f32ab3713e9867747f150df3698e456744e (patch)
tree20aabb18d88ee72a4fd412e17ebe30585496bd97 /include/sockets.h
parent20ce170024779aebbc1462146905c976836a552f (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 'include/sockets.h')
-rw-r--r--include/sockets.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/sockets.h b/include/sockets.h
index 0dfa5d9d0..ca61f7efc 100644
--- a/include/sockets.h
+++ b/include/sockets.h
@@ -59,7 +59,7 @@ union CoreExport sockaddrs
/** Check if this sockaddr has data in it
*/
- bool operator()() const;
+ bool valid() const;
/** Compares with sockaddr with another. Compares address type, port, and address
* @return true if they are the same
@@ -82,8 +82,6 @@ union CoreExport sockaddrs
* @throws A socket exception if given an invalid structure
*/
void ntop(int type, const void *src);
-
- bool valid() const;
};
class CoreExport cidr
@@ -94,6 +92,7 @@ class CoreExport cidr
public:
cidr(const Anope::string &ip);
cidr(const Anope::string &ip, unsigned char len);
+ cidr(const sockaddrs &ip, unsigned char len);
Anope::string mask() const;
bool match(const sockaddrs &other);
bool valid() const;