From d59b89205e09270d51f303b86ec6d71f36087a79 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 27 Jul 2007 18:11:03 +0000 Subject: [PATCH] Tidyups, remove of ifdefs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7597 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 21 ++++++++------------- src/users.cpp | 3 --- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 1de46e316..c0a77a28d 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -552,19 +552,16 @@ void SocketTimeout::Tick(time_t now) bool InspSocket::Poll() { -#ifdef WINDOWS - if(Instance->SE->GetRef(this->fd) != this) - return false; int incoming = -1; -#else - if (this->Instance->SE->GetRef(this->fd) != this) - return false; - int incoming = -1; - - if ((fd < 0) || (fd > MAX_DESCRIPTORS)) +#ifndef WINDOWS + if (!Instance->SE->BoundsCheckFd(this)) return false; #endif + + if (Instance->SE->GetRef(this->fd) != this) + return false; + switch (this->state) { case I_CONNECTING: @@ -575,14 +572,12 @@ bool InspSocket::Poll() if (this->fd > -1) { this->Instance->SE->DelFd(this); - this->SetState(I_CONNECTED); if (!this->Instance->SE->AddFd(this)) return false; } -#else - this->SetState(I_CONNECTED); #endif - Instance->Log(DEBUG,"Inspsocket I_CONNECTING state"); + this->SetState(I_CONNECTED); + if (Instance->Config->GetIOHook(this)) { Instance->Log(DEBUG,"Hook for raw connect"); diff --git a/src/users.cpp b/src/users.cpp index 97e2291be..cc01c3480 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1036,7 +1036,6 @@ void userrec::CheckClass() void userrec::FullConnect() { - ServerInstance->Log(DEBUG,"FullConnect"); ServerInstance->stats->statsConnects++; this->idle_lastmsg = ServerInstance->Time(); @@ -1117,8 +1116,6 @@ void userrec::FullConnect() FOREACH_MOD(I_OnPostConnect,OnPostConnect(this)); ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]", this->GetPort(), this->nick, this->ident, this->host, this->GetIPString(), this->fullname); - - ServerInstance->Log(DEBUG,"Exit FullConnect"); } /** userrec::UpdateNick() -- 2.39.5