summaryrefslogtreecommitdiff
path: root/src/dns.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 12:54:19 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 12:54:19 +0000
commit4c6bae4e369ba9a3d8afe2c7e50304ff5d12a650 (patch)
treee3e5dcc370cff469347e176affc708f0ec5420fe /src/dns.cpp
parentc07c9729f37becb33900a9ff8b0b08ee1e8648a1 (diff)
Moved serverstats stuff out
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2529 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/dns.cpp')
-rw-r--r--src/dns.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index 63322385a..efb690dc2 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -42,7 +42,6 @@ using namespace std;
extern InspIRCd* ServerInstance;
extern ServerConfig* Config;
-serverstats* stats;
#define max(a,b) (a > b ? a : b)
#define DNS_MAX 8 /* max number of nameservers used */
@@ -656,7 +655,7 @@ DNS::~DNS()
bool DNS::ReverseLookup(std::string ip)
{
- stats->statsDns++;
+ ServerInstance->stats->statsDns++;
binip = dns_aton4(ip.c_str());
if (binip == NULL) {
return false;
@@ -676,7 +675,7 @@ bool DNS::ReverseLookup(std::string ip)
bool DNS::ForwardLookup(std::string host)
{
- stats->statsDns++;
+ ServerInstance->stats->statsDns++;
this->myfd = dns_getip4(host.c_str());
if (this->myfd == -1)
{
@@ -722,11 +721,11 @@ std::string DNS::GetResult()
ServerInstance->SE->DelFd(this->myfd);
#endif
if (result) {
- stats->statsDnsGood++;
+ ServerInstance->stats->statsDnsGood++;
dns_close(this->myfd);
return result;
} else {
- stats->statsDnsBad++;
+ ServerInstance->stats->statsDnsBad++;
if (this->myfd != -1)
{
dns_close(this->myfd);
@@ -749,7 +748,7 @@ std::string DNS::GetResultIP()
}
if (result)
{
- stats->statsDnsGood++;
+ ServerInstance->stats->statsDnsGood++;
unsigned char a = (unsigned)result[0];
unsigned char b = (unsigned)result[1];
unsigned char c = (unsigned)result[2];
@@ -759,7 +758,7 @@ std::string DNS::GetResultIP()
}
else
{
- stats->statsDnsBad++;
+ ServerInstance->stats->statsDnsBad++;
log(DEBUG,"DANGER WILL ROBINSON! NXDOMAIN for forward lookup, but we got a reverse lookup!");
return "";
}