From 51a6134f9cc5e48de5781843b5f6759127185a6c Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 19 Jun 2005 16:11:47 +0000 Subject: [PATCH] Final code for the big test --- mbcico/binkp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mbcico/binkp.c b/mbcico/binkp.c index e2bdfdbe..86ade7c9 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -1805,8 +1805,12 @@ int binkp_send_frame(int cmd, char *buf, int len) last = bp.cmpblksize; /* * Only use compression for DATA blocks larger then 20 bytes. + * Also, don't send PLZ blocks if GZ or BZ2 mode is active. + * This means if the current file is send uncompressed we still + * might send some blocks compressed. The receiver needs to deal + * with this if it showed PLZ, GZ and BZ2 options. */ - if ((bp.PLZflag == Active) && (len > 20) && (!cmd)) { + if ((bp.PLZflag == Active) && (len > 20) && (!cmd) && (bp.tmode != CompGZ) && (bp.tmode != CompBZ2)) { zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char)); zlen = BINKP_PLZ_BLOCK -1; rcz = compress2(zbuf, &zlen, buf, len, 9);