From 82ebe116132fb9b64005f8fafc8b5ed34ed8d8eb Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 22 Oct 2006 12:50:06 +0000 Subject: Tweaks to drain socket on write git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5513 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 4a37b1b04..2ddc3cf75 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -331,9 +331,10 @@ int InspSocket::Write(const std::string &data) bool InspSocket::FlushWriteBuffer() { + errno = 0; if ((this->fd > -1) && (this->state == I_CONNECTED)) { - if (outbuffer.size()) + while (outbuffer.size() && (errno != EAGAIN)) { int result = write(this->fd,outbuffer[0].c_str(),outbuffer[0].length()); if (result > 0) -- cgit v1.2.3