summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}