summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-11 21:35:34 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-11 21:35:34 +0000
commit13c13df347b8cb6bf615517651945597e93d6330 (patch)
treed9d0f5feb8dcdda71a55725eb5038e95efa7dfc2 /src/modules
parent9417b5660fec288e25380f9100cf822006bc9fd2 (diff)
And give it error checking... whoops.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5942 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ziplink.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp
index 6068ee9d4..65b9d99e7 100644
--- a/src/modules/extra/m_ziplink.cpp
+++ b/src/modules/extra/m_ziplink.cpp
@@ -363,10 +363,21 @@ class ModuleZLib : public Module
int ret = write(fd, session->outbuf.data(), session->outbuf.length());
- ServerInstance->Log(DEBUG,"Sending frame of size %d", ntohl(x));
+ if (ret > 0)
+ session->outbuf = session->outbuf.substr(ret);
+ else if (ret < 1)
+ {
+ if (ret == -1)
+ return errno == EAGAIN;
+ else
+ return 0;
+ }
- session->outbuf = session->outbuf.substr(ret);
+ ServerInstance->Log(DEBUG,"Sending frame of size %d", ntohl(x));
+ /* ALL LIES the lot of it, we havent really written
+ * this amount, but the layer above doesnt need to know.
+ */
return ocount;
}