diff options
Diffstat (limited to 'src/core/netclient.cc')
-rw-r--r-- | src/core/netclient.cc | 5 |
1 files changed, 3 insertions, 2 deletions
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 |