diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-31 09:03:28 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-31 09:03:28 +0000 |
commit | 4b527153ccf2a2830e38038ce4cf06ccc764d310 (patch) | |
tree | e52cf44100bf894f435d6e726f45c680f19a0826 /src/core/netclient.cc | |
parent | da0715c2648b662892a72e32e8528a08608d0d0b (diff) |
fix zlib type issues on 32-bit systems
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 |