]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Allow ulines to still notice the channel regardless of +T
[user/henk/code/inspircd.git] / src / socket.cpp
index 6d065e83535486b80be9243fa47a622b8a6b698c..160f0f652dd04a8c6774a3f13d4546c7ecf6c67a 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -40,7 +40,7 @@ using namespace std;
 extern InspIRCd* ServerInstance;
 extern time_t TIME;
 
-InspSocket* socket_ref[65535];
+InspSocket* socket_ref[MAX_DESCRIPTORS];
 
 InspSocket::InspSocket()
 {
@@ -162,8 +162,15 @@ char* InspSocket::Read()
        }
        else
        {
-               log(DEBUG,"EOF or error on socket");
-               return NULL;
+               if (n == EAGAIN)
+               {
+                       return "";
+               }
+               else
+               {
+                       log(DEBUG,"EOF or error on socket");
+                       return NULL;
+               }
        }
 }
 
@@ -241,6 +248,9 @@ bool InspSocket::Poll()
                break;
        }
 
+       if (this->Buffer.length())
+               this->FlushWriteBuffer();
+
        return true;
 }
 
@@ -273,7 +283,3 @@ InspSocket::~InspSocket()
        this->Close();
 }
 
-/*
-int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr)
-int OpenTCPSocket (void)
-*/