]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Make irc::spacify take 'const char*' instead of 'char*'
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index 1096162db45374e9416102f16020da0a44b64255..34f4a6201a9e86304f9c9cefa00419b355002022 100644 (file)
@@ -2,12 +2,9 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
@@ -367,7 +364,6 @@ bool InspSocket::FlushWriteBuffer()
                        {
                                try
                                {
-                                       Instance->Log(DEBUG,"To write: %s", outbuffer[0].c_str());
                                        int result = Instance->Config->GetIOHook(this)->OnRawSocketWrite(this->fd, outbuffer[0].c_str(), outbuffer[0].length());
                                        if (result > 0)
                                        {
@@ -391,6 +387,15 @@ bool InspSocket::FlushWriteBuffer()
                                                this->Close();
                                                return true;
                                        }
+                                       else if (result == 0)
+                                       {
+                                               this->Instance->Log(DEBUG,"Write error on socket: EOF");
+                                               this->OnError(I_ERR_WRITE);
+                                               this->state = I_ERROR;
+                                               this->Instance->SE->DelFd(this);
+                                               this->Close();
+                                               return true;
+                                       }
                                }
                                catch (ModuleException& modexcept)
                                {
@@ -506,7 +511,7 @@ bool InspSocket::Poll()
                                if (!this->Instance->SE->AddFd(this))
                                        return false;
                        }
-                       if (this->IsIOHooked)
+                       if (Instance->Config->GetIOHook(this))
                        {
                                try
                                {