From 9417b5660fec288e25380f9100cf822006bc9fd2 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 11 Dec 2006 21:33:11 +0000 Subject: Pinch simple output buffering from m_ssl_openssl git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5941 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ziplink.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modules') 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; } } -- cgit v1.2.3