char* InspSocket::Read()
{
-#ifdef WINDOWS
- if ((fd < 0) || (m_internalFd > MAX_DESCRIPTORS))
-#else
- if ((fd < 0) || (fd > MAX_DESCRIPTORS))
-#endif
+ if (!Instance->SE->BoundsCheckFd(this))
return NULL;
int n = 0;
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:
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");
if ((!*this->host) || strchr(this->host, ':'))
length = sizeof(sockaddr_in6);
#endif
+ void* m_acceptEvent = NULL;
+ GetExt("windows_acceptevent", m_acceptEvent);
incoming = _accept (this->fd, client, &length);
#ifdef IPV6
if ((!*this->host) || strchr(this->host, ':'))