]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dnsqueue.cpp
Decide that it wasn't quite appropriate :(
[user/henk/code/inspircd.git] / src / dnsqueue.cpp
index cd6f696d684775084df023723b2fd0111615278b..8be3ea99b0b742a3312866e5b5c80aca0f6cf6f3 100644 (file)
@@ -71,11 +71,13 @@ public:
        Lookup()
        {
                *u = 0;
+               hostname = "";
        }
 
        void Reset()
        {
                *u = 0;
+               hostname = "";
        }
 
        ~Lookup()
@@ -93,7 +95,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 +133,13 @@ public:
                                                        {
                                                                strlcpy(usr->host,hostname.c_str(),MAXBUF);
                                                                strlcpy(usr->dhost,hostname.c_str(),MAXBUF);
-                                                               address_hash::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;
                                                        return true;
@@ -176,6 +179,7 @@ public:
                                        {
                                                if ((usr->registered > 3) || (hostname == ""))
                                                {
+                                                       WriteServ(usr->fd,"NOTICE Auth :*** Could not resolve your hostname -- Using your IP address instead");
                                                        usr->dns_done = true;
                                                        return true;
                                                }
@@ -210,17 +214,16 @@ bool lookup_dns(std::string nick)
        if (u)
        {
                /* Check the cache */
-               address_hash::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