diff options
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ziplink.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
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); |