diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-14 10:23:14 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-14 10:23:14 +0000 |
commit | 44d3b5b82626f627069033c7bf019d4b1564b21c (patch) | |
tree | 6ccd51977679bc15e9823baa5fcab80892eae1d4 /src/dns.cpp | |
parent | b70de5aa7840e8b43c9c5bdbeb0146ec1d5ea1a0 (diff) |
Half way through updating to move a ton of extern confs into class ServerConfig
WILL NOT RUN ATM
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2392 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r-- | src/dns.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/dns.cpp b/src/dns.cpp index 9d67d5c12..3c4701ed6 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -40,8 +40,7 @@ using namespace std; #include "socketengine.h" extern SocketEngine* SE; - -extern int statsAccept,statsRefused,statsUnknown,statsCollisions,statsDns,statsDnsGood,statsDnsBad,statsConnects,statsSent,statsRecv; +serverstats* stats; #define max(a,b) (a > b ? a : b) #define DNS_MAX 8 /* max number of nameservers used */ @@ -655,7 +654,7 @@ DNS::~DNS() bool DNS::ReverseLookup(std::string ip) { - statsDns++; + stats->statsDns++; binip = dns_aton4(ip.c_str()); if (binip == NULL) { return false; @@ -675,7 +674,7 @@ bool DNS::ReverseLookup(std::string ip) bool DNS::ForwardLookup(std::string host) { - statsDns++; + stats->statsDns++; this->myfd = dns_getip4(host.c_str()); if (this->myfd == -1) { @@ -721,11 +720,11 @@ std::string DNS::GetResult() SE->DelFd(this->myfd); #endif if (result) { - statsDnsGood++; + stats->statsDnsGood++; dns_close(this->myfd); return result; } else { - statsDnsBad++; + stats->statsDnsBad++; if (this->myfd != -1) { dns_close(this->myfd); @@ -748,7 +747,7 @@ std::string DNS::GetResultIP() } if (result) { - statsDnsGood++; + stats->statsDnsGood++; unsigned char a = (unsigned)result[0]; unsigned char b = (unsigned)result[1]; unsigned char c = (unsigned)result[2]; @@ -758,7 +757,7 @@ std::string DNS::GetResultIP() } else { - statsDnsBad++; + stats->statsDnsBad++; log(DEBUG,"DANGER WILL ROBINSON! NXDOMAIN for forward lookup, but we got a reverse lookup!"); return ""; } |