CacheTimer(InspIRCd* Instance, DNS* thisdns)
: Timer(3600, Instance->Time(), true), ServerInstance(Instance), dns(thisdns) { }
- virtual void Tick(time_t TIME)
+ virtual void Tick(time_t)
{
dns->PruneCache();
}
{
}
- void Tick(time_t TIME)
+ void Tick(time_t)
{
if (ServerInstance->Res->requests[watchid] == watch)
{
ServerInstance->Res->Classes[watchid] = NULL;
}
ServerInstance->Res->requests[watchid] = NULL;
- DELETE(watch);
+ delete watch;
return;
}
}
/** Send requests we have previously built down the UDP socket */
int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryType qt)
{
+ ServerInstance->Log(DEBUG,"DNSRequest::SendRequests");
+
unsigned char payload[sizeof(DNSHeader)];
this->rr_class = 1;
if (ServerInstance->SE->SendTo(dnsobj, (const char*)payload, length + 12, 0, (sockaddr *) &addr, sizeof(addr)) != length+12)
return -1;
}
+
+ ServerInstance->Log(DEBUG,"Sent OK");
return 0;
}
if (!ServerInstance->BindSocket(this->GetFd(), portpass, "", false))
{
/* Failed to bind */
+ ServerInstance->Log(DEBUG,"Error binding dns socket");
ServerInstance->SE->Shutdown(this, 2);
ServerInstance->SE->Close(this);
this->SetFd(-1);
}
}
}
+ else
+ {
+ ServerInstance->Log(DEBUG,"Error creating dns socket");
+ }
}
/** Initialise the DNS UDP socket so that we can send requests */
DNS::DNS(InspIRCd* Instance) : ServerInstance(Instance)
{
+ ServerInstance->Log(DEBUG,"DNS::DNS");
/* Clear the Resolver class table */
memset(Classes,0,sizeof(Classes));
/** High level abstraction of dns used by application at large */
Resolver::Resolver(InspIRCd* Instance, const std::string &source, QueryType qt, bool &cached, Module* creator) : ServerInstance(Instance), Creator(creator), input(source), querytype(qt)
{
+ ServerInstance->Log(DEBUG,"Resolver::Resolver");
cached = false;
CQ = ServerInstance->Res->GetCache(source);
/* We shouldnt get here really */
return;
}
+ else
+ {
+ ServerInstance->Log(DEBUG,"DNS request id %d", this->myid);
+ }
}
/** Called when an error occurs */
-void Resolver::OnError(ResolverError e, const std::string &errormessage)
+void Resolver::OnError(ResolverError, const std::string&)
{
/* Nothing in here */
}
}
/** Process a socket read event */
-void DNS::HandleEvent(EventType et, int errornum)
+void DNS::HandleEvent(EventType, int)
{
/* Fetch the id and result of the next available packet */
int resultnum = 0;
/** Add a derived Resolver to the working set */
bool DNS::AddResolverClass(Resolver* r)
{
+ ServerInstance->Log(DEBUG,"AddResolverClass %08lx", r);
/* Check the pointers validity and the id's validity */
if ((r) && (r->GetId() > -1))
{