]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/user_resolver.cpp
Change module versions to use a string instead of fixed digits, and use propset ID...
[user/henk/code/inspircd.git] / src / user_resolver.cpp
index ea3b46272ef2df56f3a6af2234d07560ba8a1432..b5f03ca097ede4743ea00a083fb8fb3be135501d 100644 (file)
@@ -11,7 +11,7 @@
  * ---------------------------------------------------
  */
 
-/* $Core: libIRCDuserresolver */
+/* $Core */
 
 #include "inspircd.h"
 
@@ -36,7 +36,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
                        /* Check we didnt time out */
                        if (this->bound_user->registered != REG_ALL)
                        {
-                               bool lcached;
+                               bool lcached = false;
 #ifdef IPV6
                                if (this->bound_user->GetProtocolFamily() == AF_INET6)
                                {
@@ -54,7 +54,7 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
                }
                catch (CoreException& e)
                {
-                       ServerInstance->Log(DEBUG,"Error in resolver: %s",e.GetReason());
+                       ServerInstance->Logs->Log("RESOLVER", DEBUG,"Error in resolver: %s",e.GetReason());
                }
        }
        else if ((this->fwd) && (ServerInstance->SE->GetRef(this->bound_fd) == this->bound_user))
@@ -71,13 +71,13 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
                                if ((this->bound_user->registered != REG_ALL) && (!this->bound_user->dns_done))
                                {
                                        /* Hostnames starting with : are not a good thing (tm) */
-                                       if (*(hostname.c_str()) == ':')
+                                       if (hostname[0] == ':')
                                                hostname.insert(0, "0");
 
                                        this->bound_user->WriteServ("NOTICE Auth :*** Found your hostname (%s)%s", hostname.c_str(), (cached ? " -- cached" : ""));
                                        this->bound_user->dns_done = true;
-                                       strlcpy(this->bound_user->dhost, hostname.c_str(),64);
-                                       strlcpy(this->bound_user->host, hostname.c_str(),64);
+                                       this->bound_user->dhost.assign(hostname, 0, 64);
+                                       this->bound_user->host.assign(hostname, 0, 64);
                                        /* Invalidate cache */
                                        this->bound_user->InvalidateCache();
                                }