summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-11 22:18:21 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-11 22:18:21 +0000
commita7ee287feae827706ed4e2983abdfff7f1ed3ce0 (patch)
tree7409f053e702f1daf6b4d4923c14869f1fbde00a
parent5a88424dbb33ac825aa0b9b6525179329ee75519 (diff)
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
-rw-r--r--src/modules/extra/m_ziplink.cpp14
1 files changed, 11 insertions, 3 deletions
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;
}
}