diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-27 18:11:03 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-27 18:11:03 +0000 |
commit | d59b89205e09270d51f303b86ec6d71f36087a79 (patch) | |
tree | 6fb00edfb24272ce4c4af8adc5ccd3c1b17c39f7 /src/inspsocket.cpp | |
parent | f017306e4ef286059a1a63059309355b4b4bca77 (diff) |
Tidyups, remove of ifdefs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7597 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r-- | src/inspsocket.cpp | 21 |
1 files changed, 8 insertions, 13 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"); |