From a7ee287feae827706ed4e2983abdfff7f1ed3ce0 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 11 Dec 2006 22:18:21 +0000 Subject: Better handling of write() failure, but this might still not be exactly right. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5946 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ziplink.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp index 5a04113a2..98a524875 100644 --- a/src/modules/extra/m_ziplink.cpp +++ b/src/modules/extra/m_ziplink.cpp @@ -329,7 +329,7 @@ class ModuleZLib : public Module if(session->status != IZIP_OPEN) { CloseSession(session); - return 0; + return -1; } unsigned char compr[CHUNK]; @@ -381,11 +381,19 @@ class ModuleZLib : public Module else if (ret < 1) { if (ret == -1) - return errno == EAGAIN; + { + if (errno == EAGAIN) + return 0; + else + { + session->outbuf = ""; + return -1; + } + } else { session->outbuf = ""; - return 0; + return -1; } } -- cgit v1.2.3