* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
* E-mail:
* <brain@chatspike.net>
* <Craig@chatspike.net>
alist->next = NULL;
break;
}
- goto defaultcase;
+ memcpy(res,&h.payload[i],rr.rdlength);
+ res[rr.rdlength] = '\0';
break;
default:
- defaultcase:
memcpy(res,&h.payload[i],rr.rdlength);
res[rr.rdlength] = '\0';
break;
return true;
}
+bool DNS::ForwardLookupWithFD(std::string host, int &fd)
+{
+ ServerInstance->stats->statsDns++;
+ this->myfd = dns_getip4(host.c_str());
+ fd = this->myfd;
+ if (this->myfd == -1)
+ {
+
+ }
+ log(DEBUG,"DNS: ForwardLookupWithFD, fd=%d",this->myfd);
+ ServerInstance->SE->AddFd(this->myfd,true,X_ESTAB_MODULE);
+ return true;
+}
+
bool DNS::HasResult(int fd)
{
return (fd == this->myfd);
DNS dns2;
std::string host;
std::string ip;
- if (dns1.ReverseLookup(u->ip))
+ if (dns1.ReverseLookup((char*)inet_ntoa(u->ip4)))
{
while (!dns1.HasResult())
{
usleep(100);
}
ip = dns2.GetResultIP();
- if (ip == std::string(u->ip))
+ if (ip == std::string((char*)inet_ntoa(u->ip4)))
{
if (host.length() < 160)
{