X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Finspsocket.cpp;h=89c3a71a93a691850b70b882f5db0fddb8db8679;hb=c89cc290fbc6d53040fc8abc6fc0b0cb637beee9;hp=b8f8949dd202e7100212b94fd391c3afadf2d0f2;hpb=1f0485039a276ad1c2fa3d53d284e3a87940ec77;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index b8f8949dd..89c3a71a9 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -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 {