diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 19:42:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-11 19:42:47 +0000 |
commit | 15a937209d63498643a197b9b5361c0538a6df60 (patch) | |
tree | bdf7d71303cf44f3f87a171bdeabf8ac9757a5e1 /src/modules | |
parent | 66b53f9ef83b7099a3acc0dc071db44201188b37 (diff) |
Increase CHUNK
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5932 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_ziplink.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/extra/m_ziplink.cpp b/src/modules/extra/m_ziplink.cpp index faa5ecdbd..ebff5ebf0 100644 --- a/src/modules/extra/m_ziplink.cpp +++ b/src/modules/extra/m_ziplink.cpp @@ -44,7 +44,7 @@ static InspIRCd* SI; enum izip_status { IZIP_OPEN, IZIP_CLOSED }; -const unsigned int CHUNK = 16384; +const unsigned int CHUNK = 128 * 1024; class CountedBuffer : public classbase { @@ -376,7 +376,7 @@ class ModuleZLib : public Module return 0; } - unsigned char compr[count*2+4]; + unsigned char compr[CHUNK]; if (deflateInit(&session->c_stream, Z_BEST_COMPRESSION) != Z_OK) { @@ -386,7 +386,7 @@ class ModuleZLib : public Module session->c_stream.next_in = (Bytef*)buffer; session->c_stream.next_out = compr+4; - while ((session->c_stream.total_in < (unsigned int)count) && (session->c_stream.total_out < (unsigned int)count*2)) + while ((session->c_stream.total_in < (unsigned int)count) && (session->c_stream.total_out < CHUNK)) { session->c_stream.avail_in = session->c_stream.avail_out = 1; /* force small buffers */ if (deflate(&session->c_stream, Z_NO_FLUSH) != Z_OK) @@ -417,6 +417,8 @@ class ModuleZLib : public Module memcpy(compr, &x, sizeof(x)); write(fd, compr, session->c_stream.total_out+4); + ServerInstance->Log(DEBUG,"Sending frame of size %d", x); + return ocount; } |