summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_ziplink.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp
index f8b7a0150..6068ee9d4 100644
--- a/src/modules/extra/m_ziplink.cpp
+++ b/src/modules/extra/m_ziplink.cpp
@@ -115,6 +115,7 @@ class izip_session : public classbase
izip_status status;
int fd;
CountedBuffer* inbuf;
+ std::string outbuf;
};
class ModuleZLib : public Module
@@ -356,10 +357,16 @@ class ModuleZLib : public Module
* assembling the frame size into the same packet as the compressed frame.
*/
memcpy(compr, &x, sizeof(x));
- write(fd, compr, session->c_stream.total_out+4);
+
+ const char* string_likes_signed_chars = (const char*)compr;
+ session->outbuf.append(string_likes_signed_chars, session->c_stream.total_out+4);
+
+ int ret = write(fd, session->outbuf.data(), session->outbuf.length());
ServerInstance->Log(DEBUG,"Sending frame of size %d", ntohl(x));
+ session->outbuf = session->outbuf.substr(ret);
+
return ocount;
}
@@ -368,6 +375,7 @@ class ModuleZLib : public Module
if (session->status = IZIP_OPEN)
{
session->status = IZIP_CLOSED;
+ session->outbuf = "";
delete session->inbuf;
}
}