diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 21:35:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 21:35:34 +0000 |
commit | 13c13df347b8cb6bf615517651945597e93d6330 (patch) | |
tree | d9d0f5feb8dcdda71a55725eb5038e95efa7dfc2 | |
parent | 9417b5660fec288e25380f9100cf822006bc9fd2 (diff) |
And give it error checking... whoops.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5942 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/extra/m_ziplink.cpp | 15 |
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; } |