/* This is used when working on a new protocol version in CVS, and should
* be a new non-zero value for each CVS change that affects the protocol.
* It must ALWAYS be 0 when the protocol goes final (and NEVER before)! */
-#define SUBPROTOCOL_VERSION 13
+#define SUBPROTOCOL_VERSION 14
/* We refuse to interoperate with versions that are not in this range.
* Note that we assume we'll work with later versions: the onus is on
#include "zlib/zlib.h"
extern int do_compression;
+extern int protocol_version;
extern int module_id;
extern int def_compress_level;
extern char *skip_compress;
toklen -= n1;
tx_strm.next_in = (Bytef *)map_ptr(buf, offset, n1);
tx_strm.avail_in = n1;
+ if (protocol_version >= 31) /* Newer protocols avoid a data-duplicating bug */
+ offset += n1;
tx_strm.next_out = (Bytef *) obuf;
tx_strm.avail_out = AVAIL_OUT_SIZE(CHUNK_SIZE);
r = deflate(&tx_strm, Z_INSERT_ONLY);
} else {
rx_strm.next_in = (Bytef *)buf;
rx_strm.avail_in = blklen;
+ if (protocol_version >= 31) /* Newer protocols avoid a data-duplicating bug */
+ buf += blklen;
len -= blklen;
blklen = 0;
}