diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-01-18 19:36:41 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-01-18 19:36:41 +0000 |
commit | 7e46119759b7099c38f543bd38d0186b9806542f (patch) | |
tree | b31264c454e26566b2e70c2794b89d77f4e28c44 /include/dns.h | |
parent | 42592c0083505777e8fb8e4bf09182528229a787 (diff) |
Remove excessive gettimeofday system calls
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12293 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/dns.h')
-rw-r--r-- | include/dns.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/dns.h b/include/dns.h index f79121ab3..3d326a69c 100644 --- a/include/dns.h +++ b/include/dns.h @@ -84,19 +84,12 @@ class CoreExport CachedQuery * @param res The result data, an IP or hostname * @param ttl The time-to-live value of the query result */ - CachedQuery(const std::string &res, unsigned int ttl) : data(res) - { - expires = time(NULL) + ttl; - } + CachedQuery(const std::string &res, unsigned int ttl); /** Returns the number of seconds remaining before this * cache item has expired and should be removed. */ - int CalcTTLRemaining() - { - int n = (int)expires - (int)time(NULL); - return (n < 0 ? 0 : n); - } + int CalcTTLRemaining(); }; /** DNS cache information. Holds IPs mapped to hostnames, and hostnames mapped to IPs. |