]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dnsqueue.cpp
Remove an extern, partly because it's unused, partly because it then gets shadowed...
[user/henk/code/inspircd.git] / src / dnsqueue.cpp
index 6d62b7ede9a228ec8d2bd2df58882c3d22f368bf..73d80d11d02804b3fc526979d49dc7e560a7dc60 100644 (file)
  * ---------------------------------------------------
  */
 
-using namespace std;
-
 #include "inspircd_config.h"
 #include "inspircd.h"
-#include "inspircd_io.h"
+#include "configreader.h"
 #include <unistd.h>
 #include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
-#include <cstdio>
-#include <time.h>
 #include <string>
-#ifdef GCC3
-#include <ext/hash_map>
-#else
-#include <hash_map>
-#endif
-#include <map>
-#include <sstream>
-#include <vector>
-#include <deque>
 #include "users.h"
 #include "globals.h"
 #include "inspstring.h"
 #include "dnsqueue.h"
-#include <time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <string.h>
 #include "dns.h"
 #include "helperfuncs.h"
 #include "hashcomp.h"
 #include "socketengine.h"
+#include "socket.h"
 
 extern ServerConfig* Config;
 extern InspIRCd* ServerInstance;
@@ -127,7 +109,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);
@@ -205,7 +187,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);
@@ -288,4 +270,3 @@ void dns_poll(int fdcheck)
        if (ServerInstance && ServerInstance->SE)
                ServerInstance->SE->DelFd(fdcheck);
 }
-