From 28da041573d03c04d9e9edd21a2f96fcf6c36a48 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 6 Jul 2007 16:14:24 +0000 Subject: SSL buffering tweaks. NOTE this is not a complete fix till i say so, don't use this in production yet unless youre a masochist. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7427 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 63964c1ea..f76543562 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -449,28 +449,11 @@ bool InspSocket::FlushWriteBuffer() { try { - int result = Instance->Config->GetIOHook(this)->OnRawSocketWrite(this->fd, outbuffer[0].c_str(), outbuffer[0].length()); - if (result > 0) - { - if ((unsigned int)result >= outbuffer[0].length()) - { - outbuffer.pop_front(); - } - else - { - std::string temp = outbuffer[0].substr(result); - outbuffer[0] = temp; - errno = EAGAIN; - } - } - else if (((result == -1) && (errno != EAGAIN)) || (result == 0)) - { - this->OnError(I_ERR_WRITE); - this->state = I_ERROR; - this->Instance->SE->DelFd(this); - this->Close(); - return true; - } + /* XXX: The lack of buffering here is NOT a bug, modules implementing this interface have to + * implement their own buffering mechanisms + */ + Instance->Config->GetIOHook(this)->OnRawSocketWrite(this->fd, outbuffer[0].c_str(), outbuffer[0].length()); + outbuffer.pop_front(); } catch (CoreException& modexcept) { -- cgit v1.2.3