X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fdnsqueue.cpp;h=6d62b7ede9a228ec8d2bd2df58882c3d22f368bf;hb=bb81e1a5f38b1d6487e53aa5ac69ca7ced9f6562;hp=36128f985eb6349c24fb1e8536183c9e98acd5b7;hpb=9b4c7f385f0175f27e8d33de87827b65d89f5318;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/dnsqueue.cpp b/src/dnsqueue.cpp index 36128f985..6d62b7ede 100644 --- a/src/dnsqueue.cpp +++ b/src/dnsqueue.cpp @@ -53,8 +53,6 @@ using namespace std; extern ServerConfig* Config; extern InspIRCd* ServerInstance; -address_cache addrcache; - class Lookup; Lookup* dnslist[MAX_DESCRIPTORS]; @@ -71,11 +69,13 @@ public: Lookup() { *u = 0; + hostname = ""; } void Reset() { *u = 0; + hostname = ""; } ~Lookup() @@ -93,7 +93,7 @@ public: { return false; } - strlcpy(u,nick.c_str(),NICKMAX); + strlcpy(u,nick.c_str(),NICKMAX-1); /* ASSOCIATE WITH DNS LOOKUP LIST */ if (resolver1.GetFD() != -1) @@ -131,12 +131,12 @@ public: { strlcpy(usr->host,hostname.c_str(),MAXBUF); strlcpy(usr->dhost,hostname.c_str(),MAXBUF); - address_cache::iterator address = addrcache.find(usr->ip4); + /*address_cache::iterator address = addrcache.find(usr->ip4); if (address == addrcache.end()) { log(DEBUG,"Caching hostname %s -> %s",(char*)inet_ntoa(usr->ip4),hostname.c_str()); addrcache[usr->ip4] = new std::string(hostname); - } + }*/ WriteServ(usr->fd,"NOTICE Auth :*** Found your hostname"); } usr->dns_done = true; @@ -212,17 +212,16 @@ bool lookup_dns(std::string nick) if (u) { /* Check the cache */ - address_cache::iterator address = addrcache.find(u->ip4); + /*address_cache::iterator address = addrcache.find(u->ip4); if (address != addrcache.end()) { - /* Theyre in the cache, dont waste a lookup */ WriteServ(u->fd,"NOTICE Auth :*** Found your hostname (cached)"); log(DEBUG,"Found cached host"); strlcpy(u->host,address->second->c_str(),MAXBUF); strlcpy(u->dhost,address->second->c_str(),MAXBUF); u->dns_done = true; return true; - } + }*/ /* If the user exists, create a new * lookup object, and associate it * with the user. The lookup object