]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
Merge pull request #1059 from OVERdrive-IRC/m_repeat/fix-typo
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index b8f8949dd202e7100212b94fd391c3afadf2d0f2..89c3a71a93a691850b70b882f5db0fddb8db8679 100644 (file)
@@ -201,49 +201,12 @@ void StreamSocket::DoWrite()
 
        if (GetIOHook())
        {
-               {
-                       while (error.empty() && !sendq.empty())
-                       {
-                               if (sendq.size() > 1 && sendq.front().length() < 1024)
-                               {
-                                       // Avoid multiple repeated SSL encryption invocations
-                                       // This adds a single copy of the queue, but avoids
-                                       // much more overhead in terms of system calls invoked
-                                       // by the IOHook.
-                                       //
-                                       // The length limit of 1024 is to prevent merging strings
-                                       // more than once when writes begin to block.
-                                       std::string tmp;
-                                       tmp.reserve(1280);
-                                       while (!sendq.empty() && tmp.length() < 1024)
-                                       {
-                                               tmp.append(sendq.front());
-                                               sendq.pop_front();
-                                       }
-                                       sendq.push_front(tmp);
-                               }
+               int rv = GetIOHook()->OnStreamSocketWrite(this);
+               if (rv < 0)
+                       SetError("Write Error"); // will not overwrite a better error message
 
-                               {
-                                       int rv = GetIOHook()->OnStreamSocketWrite(this);
-                                       if (rv > 0)
-                                       {
-                                               // consumed the entire string, and is ready for more
-                                               sendq.pop_front();
-                                       }
-                                       else if (rv == 0)
-                                       {
-                                               // socket has blocked. Stop trying to send data.
-                                               // IOHook has requested unblock notification from the socketengine
-                                               return;
-                                       }
-                                       else
-                                       {
-                                               SetError("Write Error"); // will not overwrite a better error message
-                                               return;
-                                       }
-                               }
-                       }
-               }
+               // rv == 0 means the socket has blocked. Stop trying to send data.
+               // IOHook has requested unblock notification from the socketengine.
        }
        else
        {