From e06a27ff0c52acbee3299614c2f60d2cb53a9e60 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 2 May 2005 17:23:40 +0000 Subject: Added /stats T git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1280 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/dns.cpp') diff --git a/src/dns.cpp b/src/dns.cpp index 8e3f4f48d..a9039fcdc 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include "dns.h" -static const char tagstring[] = "$Id$"; +extern int statsAccept,statsRefused,statsUnknown,statsCollisions,statsDns,statsDnsGood,statsDnsBad,statsConnects,statsSent,statsRecv; #define max(a,b) (a > b ? a : b) #define DNS_MAX 8 /* max number of nameservers used */ @@ -691,6 +691,7 @@ DNS::~DNS() bool DNS::ReverseLookup(std::string ip) { + statsDns++; binip = dns_aton4(ip.c_str()); if (binip == NULL) { return false; @@ -723,9 +724,11 @@ std::string DNS::GetResult() { result = dns_getresult(this->fd); if (result) { + statsDnsGood++; dns_close(this->fd); return result; } else { + statsDnsBad++; return ""; } } -- cgit v1.2.3