]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Fix potential for ssl to block, based on patch submitted by djGrrr, adjusted for...
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index be90b6e8491391287829e8de7986a8ed6ffcffba..dc0c5bebafc7e519f22252f9f683837de4066e83 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include "socket.h"
-#include "configreader.h"
 #include "inspstring.h"
 #include "socketengine.h"
 #include "inspircd.h"
@@ -501,6 +500,12 @@ bool InspSocket::FlushWriteBuffer()
                                                errno = EAGAIN;
                                        }
                                }
+                               else if (result == 0)
+                               {
+                                       this->Instance->SE->DelFd(this);
+                                       this->Close();
+                                       return true;
+                               }
                                else if ((result == -1) && (errno != EAGAIN))
                                {
                                        this->OnError(I_ERR_WRITE);
@@ -610,6 +615,8 @@ bool InspSocket::Poll()
                        }
                        else
 #endif
+                       Instance->SE->NonBlocking(incoming);
+
                        recvip = inet_ntoa(((sockaddr_in*)client)->sin_addr);
                        this->OnIncomingConnection(incoming, (char*)recvip.c_str());