summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-22 12:50:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-22 12:50:06 +0000
commit82ebe116132fb9b64005f8fafc8b5ed34ed8d8eb (patch)
treecbe367113d7f0e2f29a38d0d49949522a99ab01b
parent3136e030975ad14a7d883bfd1f7dcfd520932a91 (diff)
Tweaks to drain socket on write
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5513 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspsocket.cpp3
1 files changed, 2 insertions, 1 deletions
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)