X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fdns.cpp;h=dea55c6c15ef7467c8860e0f745e580738f6ba6b;hb=54c49b40f74d5658a6a7b060c7bd306cd085de1a;hp=447b90781ba0d8436053ae2422fcc82fd4b39618;hpb=da074814501f23680b579feb1ad649c86e8a1348;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/dns.cpp b/src/dns.cpp index 447b90781..dea55c6c1 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -11,7 +11,7 @@ * --------------------------------------------------- */ -/* $Core: libIRCDasyncdns */ +/* $Core */ /* dns.cpp - Nonblocking DNS functions. @@ -791,6 +791,7 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, int length, int result_we_w rr.type = DNS_QUERY_NONE; rr.rdlength = 0; rr.ttl = 1; /* GCC is a whiney bastard -- see the XXX below. */ + rr.rr_class = 0; /* Same for VC++ */ if (!(header.flags1 & FLAGS_MASK_QR)) return std::make_pair((unsigned char*)NULL,"Not a query result"); @@ -933,7 +934,6 @@ DNS::~DNS() ServerInstance->SE->Shutdown(this, 2); ServerInstance->SE->Close(this); ServerInstance->Timers->DelTimer(this->PruneTimer); - delete this->PruneTimer; } CachedQuery* DNS::GetCache(const std::string &source) @@ -1116,7 +1116,7 @@ void DNS::HandleEvent(EventType, int) /** Add a derived Resolver to the working set */ bool DNS::AddResolverClass(Resolver* r) { - ServerInstance->Logs->Log("RESOLVER",DEBUG,"AddResolverClass %08lx", r); + ServerInstance->Logs->Log("RESOLVER",DEBUG,"AddResolverClass 0x%08lx", (unsigned long)r); /* Check the pointers validity and the id's validity */ if ((r) && (r->GetId() > -1)) { @@ -1169,9 +1169,10 @@ unsigned long DNS::PRNG() timeval n; serverstats* s = ServerInstance->stats; gettimeofday(&n,NULL); - val = (n.tv_usec ^ getpid() ^ geteuid() ^ (this->currid++)) ^ s->statsAccept + n.tv_sec; - val = val + s->statsCollisions ^ s->statsDnsGood - s->statsDnsBad; + val = (n.tv_usec ^ (getpid() ^ geteuid()) ^ ((this->currid++)) ^ s->statsAccept) + n.tv_sec; + val = val + (s->statsCollisions ^ s->statsDnsGood) - s->statsDnsBad; val += (s->statsConnects ^ (unsigned long)s->statsSent ^ (unsigned long)s->statsRecv) - ServerInstance->Config->ports.size(); return val; } +