From 32e3caa89ad805e0332e02b12523d9c3ed84a746 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 11 Dec 2006 20:16:24 +0000 Subject: Damnit damnit damnit! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5937 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ziplink.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp index b755d7b40..882a14f56 100644 --- a/src/modules/extra/m_ziplink.cpp +++ b/src/modules/extra/m_ziplink.cpp @@ -273,10 +273,9 @@ class ModuleZLib : public Module { session->inbuf->AddData(compr, readresult); - int size = session->inbuf->GetFrame(compr, CHUNK); - while ((size) && (total_decomp < count)) + int size = 0; + while ((size = session->inbuf->GetFrame(compr, CHUNK)) != 0) { - session->d_stream.next_in = (Bytef*)compr; session->d_stream.avail_in = 0; session->d_stream.next_out = (Bytef*)(buffer + total_decomp); @@ -297,15 +296,10 @@ class ModuleZLib : public Module total_in_uncompressed += session->d_stream.total_out; total_decomp += session->d_stream.total_out; - - buffer[total_decomp] = 0; - - ServerInstance->Log(DEBUG,"Decompressed %d bytes, total_decomp=%d: '%s'", session->d_stream.total_out, total_decomp, buffer); - - if (total_decomp < count) - size = session->inbuf->GetFrame(compr, CHUNK); } + buffer[total_decomp] = 0; + ServerInstance->Log(DEBUG,"Complete buffer: '%s' size=%d", buffer, total_decomp); } return (readresult > 0); -- cgit v1.2.3