summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-11 21:33:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-11 21:33:11 +0000
commit9417b5660fec288e25380f9100cf822006bc9fd2 (patch)
treee518520b1933d418a129f30b894bbd76c73e680c /src/modules
parent4767bc95ae2893fb557132bfed917dbfb07acd9e (diff)
Pinch simple output buffering from m_ssl_openssl
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5941 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-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;
}
}