]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
2.0.0 release
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index e3b8f8c8a83a962e15363117ec272467dcb93960..92625ac29e91691ce94bf5ca5949b5aef987d3a7 100644 (file)
@@ -104,7 +104,7 @@ BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs&
 
        this->state = I_CONNECTING;
 
-       if (!ServerInstance->SE->AddFd(this, FD_WANT_NO_READ | FD_WANT_SINGLE_WRITE))
+       if (!ServerInstance->SE->AddFd(this, FD_WANT_NO_READ | FD_WANT_SINGLE_WRITE | FD_WRITE_WILL_BLOCK))
                return I_ERR_NOMOREFDS;
 
        this->Timeout = new SocketTimeout(this->GetFd(), this, timeout, ServerInstance->Time());
@@ -446,11 +446,6 @@ void SocketTimeout::Tick(time_t)
                // connection.
                this->sock->OnTimeout();
                this->sock->OnError(I_ERR_TIMEOUT);
-
-               /* NOTE: We must set this AFTER DelFd, as we added
-                * this socket whilst writeable. This means that we
-                * must DELETE the socket whilst writeable too!
-                */
                this->sock->state = I_ERROR;
 
                ServerInstance->GlobalCulls.AddItem(sock);