]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ident.cpp
...because every now and again, i have to do a massive commit.
[user/henk/code/inspircd.git] / src / modules / m_ident.cpp
index 8df849902e248698ef402ca03de1b1396ccdee63..ead8a2021fcaf9712f509c338ec2457af37401a5 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -83,7 +83,6 @@ class IdentRequestSocket : public EventHandler
        IdentRequestSocket(LocalUser* u) : user(u), result(u->ident)
        {
                age = ServerInstance->Time();
-               socklen_t size = 0;
 
                SetFd(socket(user->server_sa.sa.sa_family, SOCK_STREAM, 0));
 
@@ -110,7 +109,7 @@ class IdentRequestSocket : public EventHandler
                }
 
                /* Attempt to bind (ident requests must come from the ip the query is referring to */
-               if (ServerInstance->SE->Bind(GetFd(), &bindaddr.sa, size) < 0)
+               if (ServerInstance->SE->Bind(GetFd(), bindaddr) < 0)
                {
                        this->Close();
                        throw ModuleException("failed to bind()");
@@ -119,7 +118,7 @@ class IdentRequestSocket : public EventHandler
                ServerInstance->SE->NonBlocking(GetFd());
 
                /* Attempt connection (nonblocking) */
-               if (ServerInstance->SE->Connect(this, &connaddr.sa, size) == -1 && errno != EINPROGRESS)
+               if (ServerInstance->SE->Connect(this, &connaddr.sa, connaddr.sa_size()) == -1 && errno != EINPROGRESS)
                {
                        this->Close();
                        throw ModuleException("connect() failed");
@@ -303,7 +302,7 @@ class ModuleIdent : public Module
                        RequestTimeout = 5;
        }
 
-       virtual ModResult OnUserRegister(User *user)
+       virtual ModResult OnUserRegister(LocalUser *user)
        {
                ConfigTag* tag = user->MyClass->config;
                if (!tag->getBool("useident", true))
@@ -334,7 +333,7 @@ class ModuleIdent : public Module
         * creating a Timer object and especially better than creating a
         * Timer per ident lookup!
         */
-       virtual ModResult OnCheckReady(User *user)
+       virtual ModResult OnCheckReady(LocalUser *user)
        {
                /* Does user have an ident socket attached at all? */
                IdentRequestSocket *isock = ext.get(user);
@@ -389,10 +388,10 @@ class ModuleIdent : public Module
        {
                /* Module unloading, tidy up users */
                if (target_type == TYPE_USER)
-                       OnUserDisconnect((User*)item);
+                       OnUserDisconnect((LocalUser*)item);
        }
 
-       virtual void OnUserDisconnect(User *user)
+       virtual void OnUserDisconnect(LocalUser *user)
        {
                /* User disconnect (generic socket detatch event) */
                IdentRequestSocket *isock = ext.get(user);