From 13c13df347b8cb6bf615517651945597e93d6330 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 11 Dec 2006 21:35:34 +0000 Subject: And give it error checking... whoops. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5942 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ziplink.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3