From 4b527153ccf2a2830e38038ce4cf06ccc764d310 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 31 May 2008 09:03:28 +0000 Subject: fix zlib type issues on 32-bit systems --- src/core/netclient.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/netclient.cc') diff --git a/src/core/netclient.cc b/src/core/netclient.cc index dc4a0bd..5254b23 100644 --- a/src/core/netclient.cc +++ b/src/core/netclient.cc @@ -132,7 +132,8 @@ void NetClient::transmit(int serverfd) char zbuf[BLOCKSIZE]; const char *data = 0; - size_t compressed_size = BLOCKSIZE - 5; + unsigned long compressed_size = BLOCKSIZE - 5; + unsigned long uncompressed_size = sendq.size(); size_t total_size = 0; memset(zbuf,0, sizeof(zbuf)); @@ -140,7 +141,7 @@ void NetClient::transmit(int serverfd) Stats::network_uncompressed_bytes_sent += sendq.size(); // zlib compress - int status = compress((Bytef*)(zbuf+4), &compressed_size, (Bytef*)sendq.c_str(), sendq.size()); + int status = compress((Bytef*)(zbuf+4), &compressed_size, (Bytef*)sendq.c_str(), uncompressed_size); if ((status == Z_OK) && (compressed_size + 4 < sendq.size())) { // add a header to the compress packet -- cgit v1.2.3