]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dnsqueue.cpp
More verbose error output
[user/henk/code/inspircd.git] / src / dnsqueue.cpp
index c117ad4cba5434fe886aab99a5363c5efa103b24..20118038b85c6bc988ba67f51f98dd4fa4e95727 100644 (file)
@@ -53,8 +53,6 @@ using namespace std;
 extern ServerConfig* Config;
 extern InspIRCd* ServerInstance;
 
-address_cache addrcache;
-
 class Lookup;
 
 Lookup* dnslist[MAX_DESCRIPTORS];
@@ -95,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)
@@ -129,7 +127,7 @@ public:
                                                }
                                                if ((hostname != "") && (usr->registered != 7))
                                                {
-                                                       if (std::string((char*)inet_ntoa(usr->ip4)) == ip)
+                                                       if ((std::string((char*)inet_ntoa(usr->ip4)) == ip) && (hostname.length() < 65))
                                                        {
                                                                strlcpy(usr->host,hostname.c_str(),MAXBUF);
                                                                strlcpy(usr->dhost,hostname.c_str(),MAXBUF);
@@ -207,7 +205,7 @@ public:
        }
 };
 
-bool lookup_dns(std::string nick)
+bool lookup_dns(const std::string &nick)
 {
        /* First attempt to find the nickname */
        userrec* u = Find(nick);