* ---------------------------------------------------
*/
+/* $Core: libIRCDasyncdns */
+
/*
dns.cpp - Nonblocking DNS functions.
Very very loosely based on the firedns library,
int SendRequests(const DNSHeader *header, const int length, QueryType qt);
};
-class CacheTimer : public InspTimer
+class CacheTimer : public Timer
{
private:
InspIRCd* ServerInstance;
DNS* dns;
public:
CacheTimer(InspIRCd* Instance, DNS* thisdns)
- : InspTimer(3600, Instance->Time(), true), ServerInstance(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();
}
};
-class RequestTimeout : public InspTimer
+class RequestTimeout : public Timer
{
InspIRCd* ServerInstance;
DNSRequest* watch;
int watchid;
public:
- RequestTimeout(unsigned long n, InspIRCd* SI, DNSRequest* watching, int id) : InspTimer(n, time(NULL)), ServerInstance(SI), watch(watching), watchid(id)
+ RequestTimeout(unsigned long n, InspIRCd* SI, DNSRequest* watching, int id) : Timer(n, time(NULL)), ServerInstance(SI), watch(watching), watchid(id)
{
}
- void Tick(time_t TIME)
+ void Tick(time_t)
{
if (ServerInstance->Res->requests[watchid] == watch)
{
case DNS_QUERY_AAAA:
{
- snprintf(formatted,40,"%x:%x:%x:%x:%x:%x:%x:%x",
- (ntohs(data.first[0]) + ntohs(data.first[1] << 8)),
- (ntohs(data.first[2]) + ntohs(data.first[3] << 8)),
- (ntohs(data.first[4]) + ntohs(data.first[5] << 8)),
- (ntohs(data.first[6]) + ntohs(data.first[7] << 8)),
- (ntohs(data.first[8]) + ntohs(data.first[9] << 8)),
- (ntohs(data.first[10]) + ntohs(data.first[11] << 8)),
- (ntohs(data.first[12]) + ntohs(data.first[13] << 8)),
- (ntohs(data.first[14]) + ntohs(data.first[15] << 8)));
+ inet_ntop(AF_INET6, data.first, formatted, sizeof(formatted));
char* c = strstr(formatted,":0:");
if (c != NULL)
{
}
/** 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;