X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ident.cpp;h=ead8a2021fcaf9712f509c338ec2457af37401a5;hb=cd712c40e1b352c05e7ae0f72e0a5e84cdf64323;hp=8df849902e248698ef402ca03de1b1396ccdee63;hpb=5d03657b63b0b77edc25cd566d9aab134d930bf7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 8df849902..ead8a2021 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -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);