Started development version 0.81.0

This commit is contained in:
Michiel Broek 2005-10-07 19:12:37 +00:00
parent 533006891a
commit 4122c4f309
6 changed files with 11 additions and 94 deletions

View File

@ -1,6 +1,12 @@
$Id$ $Id$
v0.81.0 07-Oct-2005
mbcico:
Made binkp GZ and BZ2 compression final.
v0.80.0 27-Oct-2004 - 06-Oct-2005 v0.80.0 27-Oct-2004 - 06-Oct-2005

View File

@ -31,5 +31,6 @@ mbsebbs-0_61_00_current 06-Jun-2004 Start 0.61 development.
mbsebbs-0_70_00_release 26-Oct-2004 Version 0.70.0 release. mbsebbs-0_70_00_release 26-Oct-2004 Version 0.70.0 release.
mbsebbs-0_71_00_current 27-Oct-2004 Start 0.71 development. mbsebbs-0_71_00_current 27-Oct-2004 Start 0.71 development.
mbsebbs-0_80_00_release 06-Oct-2004 Version 0.80.0 release. mbsebbs-0_80_00_release 06-Oct-2004 Version 0.80.0 release.
mbsebbs-0_81_00_current 07-Oct-2005 Start 0.81 development.
Michiel. Michiel.

2
TODO
View File

@ -1,6 +1,6 @@
$Id$ $Id$
MBSE BBS V0.80.0 TODO list. MBSE BBS V0.81.0 TODO list.
--------------------------- ---------------------------
These are a list of things that must be implemented one way or These are a list of things that must be implemented one way or

2
configure vendored
View File

@ -1304,7 +1304,7 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbutils mbnntp mbtask mbsetup unix lang
PACKAGE="mbsebbs" PACKAGE="mbsebbs"
MAJOR="0" MAJOR="0"
MINOR="80" MINOR="81"
REVISION="0" REVISION="0"
VERSION="$MAJOR.$MINOR.$REVISION" VERSION="$MAJOR.$MINOR.$REVISION"
COPYRIGHT="Copyright (C) 1997-2005 Michiel Broek, All Rights Reserved" COPYRIGHT="Copyright (C) 1997-2005 Michiel Broek, All Rights Reserved"

View File

@ -12,7 +12,7 @@ dnl After changeing the version number, run autoconf!
dnl dnl
PACKAGE="mbsebbs" PACKAGE="mbsebbs"
MAJOR="0" MAJOR="0"
MINOR="80" MINOR="81"
REVISION="0" REVISION="0"
VERSION="$MAJOR.$MINOR.$REVISION" VERSION="$MAJOR.$MINOR.$REVISION"
COPYRIGHT="Copyright (C) 1997-2005 Michiel Broek, All Rights Reserved" COPYRIGHT="Copyright (C) 1997-2005 Michiel Broek, All Rights Reserved"

View File

@ -89,19 +89,13 @@ typedef enum {Ok, Failure, Continue} TrType;
typedef enum {No, Can, Want, Active} OptionState; typedef enum {No, Can, Want, Active} OptionState;
typedef enum {NoState, Sending, IsSent, Got, Skipped, Get} FileState; typedef enum {NoState, Sending, IsSent, Got, Skipped, Get} FileState;
typedef enum {InitTransfer, Switch, Receive, Transmit, DeinitTransfer} FtType; typedef enum {InitTransfer, Switch, Receive, Transmit, DeinitTransfer} FtType;
#ifdef USE_EXPERIMENT
typedef enum {CompNone, CompGZ, CompBZ2, CompPLZ} CompType; typedef enum {CompNone, CompGZ, CompBZ2, CompPLZ} CompType;
#else
typedef enum {CompNone, CompPLZ} CompType;
#endif
// static char *txstate[] = { (char *)"TxGNF", (char *)"TxTryR", (char *)"TxReadS", (char *)"TxWLA", (char *)"TxDone" }; // static char *txstate[] = { (char *)"TxGNF", (char *)"TxTryR", (char *)"TxReadS", (char *)"TxWLA", (char *)"TxDone" };
static char *rxstate[] = { (char *)"RxWaitF", (char *)"RxAccF", (char *)"RxReceD", static char *rxstate[] = { (char *)"RxWaitF", (char *)"RxAccF", (char *)"RxReceD",
(char *)"RxWriteD", (char *)"RxEOB", (char *)"RxDone" }; (char *)"RxWriteD", (char *)"RxEOB", (char *)"RxDone" };
static char *opstate[] = { (char *)"No", (char *)"Can", (char *)"Want", (char *)"Active" }; static char *opstate[] = { (char *)"No", (char *)"Can", (char *)"Want", (char *)"Active" };
#ifdef USE_EXPERIMENT
static char *cpstate[] = { (char *)"No", (char *)"GZ", (char *)"BZ2", (char *)"PLZ" }; static char *cpstate[] = { (char *)"No", (char *)"GZ", (char *)"BZ2", (char *)"PLZ" };
#endif
static time_t Timer; static time_t Timer;
@ -119,7 +113,6 @@ struct timeval rxtvstart; /* Receiver start time */
struct timeval rxtvend; /* Receiver end time */ struct timeval rxtvend; /* Receiver end time */
#ifdef USE_EXPERIMENT
#if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H) #if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H)
int compress_init(int type); int compress_init(int type);
@ -134,7 +127,6 @@ int decompress_abort(int type, void *data);
#define ZBLKSIZE 1024 /* read/write file buffer size */ #define ZBLKSIZE 1024 /* read/write file buffer size */
#endif #endif
#endif
struct binkprec { struct binkprec {
@ -171,9 +163,7 @@ struct binkprec {
int rxpos; /* Receiver position */ int rxpos; /* Receiver position */
int rxcompressed; /* Receiver compressed bytes */ int rxcompressed; /* Receiver compressed bytes */
char *ropts; /* Receiver M_FILE optional args */ char *ropts; /* Receiver M_FILE optional args */
#ifdef USE_EXPERIMENT
int rmode; /* Receiver compression mode */ int rmode; /* Receiver compression mode */
#endif
struct timezone tz; /* Timezone */ struct timezone tz; /* Timezone */
@ -183,9 +173,7 @@ struct binkprec {
int txpos; /* Transmitter position */ int txpos; /* Transmitter position */
int stxpos; /* Transmitter start position */ int stxpos; /* Transmitter start position */
int txcompressed; /* Transmitter compressed bytes */ int txcompressed; /* Transmitter compressed bytes */
#ifdef USE_EXPERIMENT
int tmode; /* Transmitter compression mode */ int tmode; /* Transmitter compression mode */
#endif
long tfsize; /* Transmitter filesize */ long tfsize; /* Transmitter filesize */
int local_EOB; /* Local EOB sent */ int local_EOB; /* Local EOB sent */
@ -200,7 +188,6 @@ struct binkprec {
int buggyIrex; /* Buggy Irex detected */ int buggyIrex; /* Buggy Irex detected */
int txcpos; /* Transmitter compressed position */ int txcpos; /* Transmitter compressed position */
#ifdef USE_EXPERIMENT
#if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB2_H) #if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB2_H)
int EXTCMDwe; /* EXTCMD flag */ int EXTCMDwe; /* EXTCMD flag */
int EXTCMDthey; int EXTCMDthey;
@ -212,7 +199,6 @@ struct binkprec {
#ifdef HAVE_BZLIB_H #ifdef HAVE_BZLIB_H
int BZ2we; /* BZ2 compression flag */ int BZ2we; /* BZ2 compression flag */
int BZ2they; int BZ2they;
#endif
#endif #endif
int NRwe; /* NR mode */ int NRwe; /* NR mode */
int NRthey; int NRthey;
@ -224,11 +210,9 @@ struct binkprec {
#ifdef USE_EXPERIMENT
void *z_idata = NULL; /* Data for zstream */ void *z_idata = NULL; /* Data for zstream */
void *z_odata = NULL; /* Data for zstream */ void *z_odata = NULL; /* Data for zstream */
char *z_obuf; /* Compression buffer */ char *z_obuf; /* Compression buffer */
#endif
struct binkprec bp; /* Global structure */ struct binkprec bp; /* Global structure */
@ -288,15 +272,12 @@ int binkp(int role)
bp.remote_EOB = FALSE; bp.remote_EOB = FALSE;
bp.msgs_on_queue = 0; bp.msgs_on_queue = 0;
bp.cmpblksize = SND_BLKSIZE; bp.cmpblksize = SND_BLKSIZE;
#ifdef USE_EXPERIMENT
bp.EXTCMDwe = bp.EXTCMDthey = No; /* Default */ bp.EXTCMDwe = bp.EXTCMDthey = No; /* Default */
#endif
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
if (localoptions & NOPLZ) if (localoptions & NOPLZ)
bp.PLZthey = bp.PLZwe = No; bp.PLZthey = bp.PLZwe = No;
else else
bp.PLZthey = bp.PLZwe = Can; bp.PLZthey = bp.PLZwe = Can;
#ifdef USE_EXPERIMENT
z_obuf = calloc(MAX_BLKSIZE + 3, sizeof(unsigned char)); z_obuf = calloc(MAX_BLKSIZE + 3, sizeof(unsigned char));
if (localoptions & NOGZBZ2) if (localoptions & NOGZBZ2)
bp.GZthey = bp.GZwe = No; bp.GZthey = bp.GZwe = No;
@ -304,11 +285,9 @@ int binkp(int role)
bp.GZthey = bp.GZwe = Can; bp.GZthey = bp.GZwe = Can;
bp.EXTCMDwe = bp.EXTCMDthey = Can; bp.EXTCMDwe = bp.EXTCMDthey = Can;
} }
#endif
#else #else
bp.PLZthey = bp.PLZwe = No; bp.PLZthey = bp.PLZwe = No;
#endif #endif
#ifdef USE_EXPERIMENT
#ifdef HAVE_BZLIB_H #ifdef HAVE_BZLIB_H
if (localoptions & NOGZBZ2) if (localoptions & NOGZBZ2)
bp.BZ2they = bp.BZ2we = No; bp.BZ2they = bp.BZ2we = No;
@ -316,7 +295,6 @@ int binkp(int role)
bp.BZ2they = bp.BZ2we = Can; bp.BZ2they = bp.BZ2we = Can;
bp.EXTCMDwe = bp.EXTCMDthey = Can; bp.EXTCMDwe = bp.EXTCMDthey = Can;
} }
#endif
#endif #endif
bp.buggyIrex = FALSE; bp.buggyIrex = FALSE;
bp.NRwe = No; bp.NRwe = No;
@ -369,7 +347,6 @@ binkpend:
free(bp.txbuf); free(bp.txbuf);
if (bp.ropts) if (bp.ropts)
free(bp.ropts); free(bp.ropts);
#ifdef USE_EXPERIMENT
#if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H) #if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H)
if ((bp.rmode != CompNone) && z_idata) if ((bp.rmode != CompNone) && z_idata)
decompress_deinit(bp.rmode, z_idata); decompress_deinit(bp.rmode, z_idata);
@ -377,7 +354,6 @@ binkpend:
compress_deinit(bp.tmode, z_odata); compress_deinit(bp.tmode, z_odata);
if (z_obuf) if (z_obuf)
free(z_obuf); free(z_obuf);
#endif
#endif #endif
rc = abs(rc); rc = abs(rc);
@ -931,7 +907,6 @@ SM_STATE(PwdAck)
SM_STATE(Opts) SM_STATE(Opts)
IsDoing("Binkp from %s", ascfnode(remote->addr, 0xf)); IsDoing("Binkp from %s", ascfnode(remote->addr, 0xf));
#ifdef USE_EXPERIMENT
if (localoptions & NOGZBZ2) { if (localoptions & NOGZBZ2) {
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
bp.GZwe = bp.GZthey = No; bp.GZwe = bp.GZthey = No;
@ -942,7 +917,6 @@ SM_STATE(Opts)
Syslog('b', "Binkp: no BZ2 compression for this node"); Syslog('b', "Binkp: no BZ2 compression for this node");
#endif #endif
} }
#endif
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
if (localoptions & NOPLZ) { if (localoptions & NOPLZ) {
bp.PLZwe = bp.PLZthey = No; bp.PLZwe = bp.PLZthey = No;
@ -1070,11 +1044,9 @@ TrType binkp_receiver(void)
long written; long written;
off_t rxbytes; off_t rxbytes;
int bcmd, rc = 0; int bcmd, rc = 0;
#ifdef USE_EXPERIMENT
int rc1 = 0, nget = bp.blklen, zavail, nput; int rc1 = 0, nget = bp.blklen, zavail, nput;
char zbuf[ZBLKSIZE]; char zbuf[ZBLKSIZE];
char *buf = bp.rxbuf; char *buf = bp.rxbuf;
#endif
// Syslog('b', "Binkp: receiver %s", rxstate[bp.RxState]); // Syslog('b', "Binkp: receiver %s", rxstate[bp.RxState]);
@ -1144,26 +1116,22 @@ TrType binkp_receiver(void)
} }
} else if (bp.RxState == RxAccF) { } else if (bp.RxState == RxAccF) {
#ifdef USE_EXPERIMENT
if (((bp.rmode == CompGZ) || (bp.rmode == CompBZ2)) && z_idata) { if (((bp.rmode == CompGZ) || (bp.rmode == CompBZ2)) && z_idata) {
decompress_deinit(bp.rmode, z_idata); decompress_deinit(bp.rmode, z_idata);
z_idata = NULL; z_idata = NULL;
} }
bp.rmode = CompNone; bp.rmode = CompNone;
#endif
if (strlen(bp.rxbuf) < 512) { if (strlen(bp.rxbuf) < 512) {
snprintf(bp.rname, 512, "%s", strtok(bp.rxbuf+1, " \n\r")); snprintf(bp.rname, 512, "%s", strtok(bp.rxbuf+1, " \n\r"));
bp.rsize = atoi(strtok(NULL, " \n\r")); bp.rsize = atoi(strtok(NULL, " \n\r"));
bp.rtime = atoi(strtok(NULL, " \n\r")); bp.rtime = atoi(strtok(NULL, " \n\r"));
bp.roffs = atoi(strtok(NULL, " \n\r")); bp.roffs = atoi(strtok(NULL, " \n\r"));
snprintf(bp.ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0)); snprintf(bp.ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0));
#ifdef USE_EXPERIMENT
if (strcmp((char *)"GZ", bp.ropts) == 0) if (strcmp((char *)"GZ", bp.ropts) == 0)
bp.rmode = CompGZ; bp.rmode = CompGZ;
else if (strcmp((char *)"BZ2", bp.ropts) == 0) else if (strcmp((char *)"BZ2", bp.ropts) == 0)
bp.rmode = CompBZ2; bp.rmode = CompBZ2;
#endif
} else { } else {
/* /*
* Corrupted command, in case this was serious, send the M_GOT back so it's * Corrupted command, in case this was serious, send the M_GOT back so it's
@ -1177,13 +1145,8 @@ TrType binkp_receiver(void)
else else
return Ok; return Ok;
} }
#ifdef USE_EXPERIMENT
Syslog('+', "Binkp: receive file \"%s\" date %s size %ld offset %ld comp %s", Syslog('+', "Binkp: receive file \"%s\" date %s size %ld offset %ld comp %s",
bp.rname, date(bp.rtime), bp.rsize, bp.roffs, cpstate[bp.rmode]); bp.rname, date(bp.rtime), bp.rsize, bp.roffs, cpstate[bp.rmode]);
#else
Syslog('+', "Binkp: receive file \"%s\" date %s size %ld offset %ld",
bp.rname, date(bp.rtime), bp.rsize, bp.roffs);
#endif
(void)binkp2unix(bp.rname); (void)binkp2unix(bp.rname);
rxbytes = bp.rxbytes; rxbytes = bp.rxbytes;
@ -1319,7 +1282,6 @@ TrType binkp_receiver(void)
} }
written = 0; written = 0;
#ifdef USE_EXPERIMENT
if ((bp.rmode == CompBZ2) || (bp.rmode == CompGZ)) { if ((bp.rmode == CompBZ2) || (bp.rmode == CompGZ)) {
/* /*
* Receive stream compressed data * Receive stream compressed data
@ -1363,11 +1325,8 @@ TrType binkp_receiver(void)
z_idata = NULL; z_idata = NULL;
} }
} else { } else {
#endif
written = fwrite(bp.rxbuf, 1, bp.blklen, bp.rxfp); written = fwrite(bp.rxbuf, 1, bp.blklen, bp.rxfp);
#ifdef USE_EXPERIMENT
} }
#endif
bp.GotFrame = FALSE; bp.GotFrame = FALSE;
bp.rxlen = 0; bp.rxlen = 0;
@ -1457,10 +1416,8 @@ TrType binkp_receiver(void)
TrType binkp_transmitter(void) TrType binkp_transmitter(void)
{ {
int rc = 0, eof = FALSE; int rc = 0, eof = FALSE;
#ifdef USE_EXPERIMENT
int sz, rc1 = 0; int sz, rc1 = 0;
char *extra; char *extra;
#endif
char *nonhold_mail; char *nonhold_mail;
fa_list *eff_remote; fa_list *eff_remote;
file_list *tsl; file_list *tsl;
@ -1541,7 +1498,6 @@ TrType binkp_transmitter(void)
break; break;
} }
#ifdef USE_EXPERIMENT
bp.tmode = CompNone; bp.tmode = CompNone;
extra = (char *)""; extra = (char *)"";
@ -1560,23 +1516,15 @@ TrType binkp_transmitter(void)
Syslog('b', "Binkp: compress_init ok, extra=%s", extra); Syslog('b', "Binkp: compress_init ok, extra=%s", extra);
} }
} }
#endif
bp.txpos = bp.txcpos = bp.stxpos = tmp->offset; bp.txpos = bp.txcpos = bp.stxpos = tmp->offset;
bp.txcompressed = 0; bp.txcompressed = 0;
bp.tfsize = tmp->size; bp.tfsize = tmp->size;
Syslog('+', "Binkp: send \"%s\" as \"%s\"", MBSE_SS(tmp->local), MBSE_SS(tmp->remote)); Syslog('+', "Binkp: send \"%s\" as \"%s\"", MBSE_SS(tmp->local), MBSE_SS(tmp->remote));
#ifdef USE_EXPERIMENT
Syslog('+', "Binkp: size %lu bytes, dated %s, comp %s", Syslog('+', "Binkp: size %lu bytes, dated %s, comp %s",
(unsigned long)tmp->size, date(tmp->date), cpstate[bp.tmode]); (unsigned long)tmp->size, date(tmp->date), cpstate[bp.tmode]);
rc = binkp_send_command(MM_FILE, "%s %lu %ld %ld%s", MBSE_SS(tmp->remote), rc = binkp_send_command(MM_FILE, "%s %lu %ld %ld%s", MBSE_SS(tmp->remote),
(unsigned long)tmp->size, (long)tmp->date, (unsigned long)tmp->offset, extra); (unsigned long)tmp->size, (long)tmp->date, (unsigned long)tmp->offset, extra);
#else
Syslog('+', "Binkp: size %lu bytes, dated %s",
(unsigned long)tmp->size, date(tmp->date));
rc = binkp_send_command(MM_FILE, "%s %lu %ld %ld", MBSE_SS(tmp->remote),
(unsigned long)tmp->size, (long)tmp->date, (unsigned long)tmp->offset);
#endif
if (rc) { if (rc) {
bp.TxState = TxDone; bp.TxState = TxDone;
return Failure; return Failure;
@ -1618,7 +1566,6 @@ TrType binkp_transmitter(void)
} else if (bp.TxState == TxReadS) { } else if (bp.TxState == TxReadS) {
bp.TxState = TxTryR; bp.TxState = TxTryR;
#ifdef USE_EXPERIMENT
#if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H) #if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H)
if ((bp.tmode == CompBZ2) || (bp.tmode == CompGZ)) { if ((bp.tmode == CompBZ2) || (bp.tmode == CompGZ)) {
int nput = 0; /* number of compressed bytes */ int nput = 0; /* number of compressed bytes */
@ -1672,7 +1619,7 @@ TrType binkp_transmitter(void)
} else { } else {
#endif #endif
#endif
/* /*
* Send uncompressed block * Send uncompressed block
*/ */
@ -1693,10 +1640,8 @@ TrType binkp_transmitter(void)
return Failure; return Failure;
} }
#ifdef USE_EXPERIMENT
#if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H) #if defined(HAVE_ZLIB_H) || defined(HAVE_BZLIB_H)
} }
#endif
#endif #endif
if ((bp.txlen == 0) || eof) { if ((bp.txlen == 0) || eof) {
@ -1723,14 +1668,12 @@ TrType binkp_transmitter(void)
Syslog('+', "Binkp: transmitter skipped file after %ld seconds", txtvend.tv_sec - txtvstart.tv_sec); Syslog('+', "Binkp: transmitter skipped file after %ld seconds", txtvend.tv_sec - txtvstart.tv_sec);
} }
#ifdef USE_EXPERIMENT
if ((bp.tmode == CompBZ2) || (bp.tmode == CompGZ)) { if ((bp.tmode == CompBZ2) || (bp.tmode == CompGZ)) {
compress_deinit(bp.tmode, z_odata); compress_deinit(bp.tmode, z_odata);
z_odata = NULL; z_odata = NULL;
bp.tmode = CompNone; bp.tmode = CompNone;
Syslog('b', "Binkp: compress_deinit done"); Syslog('b', "Binkp: compress_deinit done");
} }
#endif
cursend->state = IsSent; cursend->state = IsSent;
cursend = NULL; cursend = NULL;
@ -1863,11 +1806,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
* might send some blocks compressed. The receiver needs to deal * might send some blocks compressed. The receiver needs to deal
* with this if it showed PLZ, GZ and BZ2 options. * with this if it showed PLZ, GZ and BZ2 options.
*/ */
#ifdef USE_EXPERIMENT
if ((bp.PLZwe == Active) && (len > 20) && (!cmd) && (bp.tmode != CompGZ) && (bp.tmode != CompBZ2)) { if ((bp.PLZwe == Active) && (len > 20) && (!cmd) && (bp.tmode != CompGZ) && (bp.tmode != CompBZ2)) {
#else
if ((bp.PLZwe == Active) && (len > 20) && (!cmd)) {
#endif
zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char)); zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char));
zlen = BINKP_PLZ_BLOCK -1; zlen = BINKP_PLZ_BLOCK -1;
rcz = compress2(zbuf, &zlen, buf, len, 9); rcz = compress2(zbuf, &zlen, buf, len, 9);
@ -2051,7 +1990,6 @@ int binkp_send_comp_opts(void)
int rc = 0, plz = FALSE, gz = FALSE, bz2 = FALSE; int rc = 0, plz = FALSE, gz = FALSE, bz2 = FALSE;
char *p = NULL; char *p = NULL;
#ifdef USE_EXPERIMENT
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
if ((bp.GZwe == Can) || (bp.GZthey == Can) || (bp.GZthey == Want)) { if ((bp.GZwe == Can) || (bp.GZthey == Can) || (bp.GZthey == Want)) {
gz = TRUE; gz = TRUE;
@ -2064,7 +2002,6 @@ int binkp_send_comp_opts(void)
bp.BZ2we = Want; bp.BZ2we = Want;
} }
#endif #endif
#endif
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
if ((bp.PLZwe == Can) || (bp.PLZthey == Can) || (bp.PLZthey == Want)) { if ((bp.PLZwe == Can) || (bp.PLZthey == Can) || (bp.PLZthey == Want)) {
@ -2075,12 +2012,10 @@ int binkp_send_comp_opts(void)
if (plz || gz || bz2) { if (plz || gz || bz2) {
p = xstrcpy((char *)"OPT"); p = xstrcpy((char *)"OPT");
#ifdef USE_EXPERIMENT
if (bz2 || gz) { if (bz2 || gz) {
bp.EXTCMDwe = Want; bp.EXTCMDwe = Want;
p = xstrcat(p, (char *)" EXTCMD"); p = xstrcat(p, (char *)" EXTCMD");
} }
#endif
if (gz) if (gz)
p = xstrcat(p, (char *)" GZ"); p = xstrcat(p, (char *)" GZ");
if (bz2) if (bz2)
@ -2098,7 +2033,6 @@ int binkp_send_comp_opts(void)
void binkp_set_comp_state(void) void binkp_set_comp_state(void)
{ {
#ifdef USE_EXPERIMENT
Syslog('b', "Binkp: EXTCMD they=%s we=%s", opstate[bp.EXTCMDthey], opstate[bp.EXTCMDwe]); Syslog('b', "Binkp: EXTCMD they=%s we=%s", opstate[bp.EXTCMDthey], opstate[bp.EXTCMDwe]);
if ((bp.EXTCMDthey == Want) && (bp.EXTCMDwe == Want)) { if ((bp.EXTCMDthey == Want) && (bp.EXTCMDwe == Want)) {
Syslog('+', "Binkp: EXTCMD is active"); Syslog('+', "Binkp: EXTCMD is active");
@ -2128,7 +2062,6 @@ void binkp_set_comp_state(void)
} }
#endif #endif
#endif
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
Syslog('b', "Binkp: PLZ they=%s we=%s", opstate[bp.PLZthey], opstate[bp.PLZwe]); Syslog('b', "Binkp: PLZ they=%s we=%s", opstate[bp.PLZthey], opstate[bp.PLZwe]);
@ -2249,7 +2182,6 @@ void parse_m_nul(char *msg)
free(bp.MD_Challenge); free(bp.MD_Challenge);
bp.MD_Challenge = MD_getChallenge(q, NULL); bp.MD_Challenge = MD_getChallenge(q, NULL);
} }
#ifdef USE_EXPERIMENT
} else if (strcmp(q, (char *)"EXTCMD") == 0) { } else if (strcmp(q, (char *)"EXTCMD") == 0) {
Syslog('b', "Binkp: remote wants EXTCMD mode"); Syslog('b', "Binkp: remote wants EXTCMD mode");
if (bp.EXTCMDthey == Can) { if (bp.EXTCMDthey == Can) {
@ -2273,7 +2205,6 @@ void parse_m_nul(char *msg)
binkp_set_comp_state(); binkp_set_comp_state();
} }
#endif #endif
#endif
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
} else if (strcmp(q, (char *)"PLZ") == 0) { } else if (strcmp(q, (char *)"PLZ") == 0) {
Syslog('b', "Binkp: remote wants PLZ mode"); Syslog('b', "Binkp: remote wants PLZ mode");
@ -2351,11 +2282,7 @@ int binkp_poll_frame(void)
if (bp.rxlen == 1) { if (bp.rxlen == 1) {
bp.cmd = bp.header & BINKP_CONTROL_BLOCK; bp.cmd = bp.header & BINKP_CONTROL_BLOCK;
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
#ifdef USE_EXPERIMENT
if ((bp.PLZthey == Active) && (bp.rmode == CompNone)) { if ((bp.PLZthey == Active) && (bp.rmode == CompNone)) {
#else
if (bp.PLZthey == Active) {
#endif
bp.blklen = bp.header & 0x3fff; bp.blklen = bp.header & 0x3fff;
} else { } else {
bp.blklen = bp.header & 0x7fff; bp.blklen = bp.header & 0x7fff;
@ -2370,11 +2297,7 @@ int binkp_poll_frame(void)
/* /*
* Got a PLZ compressed block * Got a PLZ compressed block
*/ */
#ifdef USE_EXPERIMENT
if ((bp.PLZthey == Active) && (bp.header & BINKP_PLZ_BLOCK) && (bp.rmode == CompNone) && bp.blklen) { if ((bp.PLZthey == Active) && (bp.header & BINKP_PLZ_BLOCK) && (bp.rmode == CompNone) && bp.blklen) {
#else
if ((bp.PLZthey == Active) && (bp.header & BINKP_PLZ_BLOCK) && bp.blklen) {
#endif
zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char)); zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char));
zlen = BINKP_PLZ_BLOCK -1; zlen = BINKP_PLZ_BLOCK -1;
rc = uncompress(zbuf, &zlen, bp.rxbuf, bp.rxlen -1); rc = uncompress(zbuf, &zlen, bp.rxbuf, bp.rxlen -1);
@ -2474,22 +2397,18 @@ int binkp_process_messages(void)
loffs = atoi(strtok(NULL, " \n\r")); loffs = atoi(strtok(NULL, " \n\r"));
snprintf(ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0)); snprintf(ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0));
Syslog('b', "Binkp: m_file options \"%s\"", ropts); Syslog('b', "Binkp: m_file options \"%s\"", ropts);
#ifdef USE_EXPERIMENT
if (strcmp((char *)"GZ", ropts) == 0) if (strcmp((char *)"GZ", ropts) == 0)
rmode = CompGZ; rmode = CompGZ;
else if (strcmp((char *)"BZ2", ropts) == 0) else if (strcmp((char *)"BZ2", ropts) == 0)
rmode = CompBZ2; rmode = CompBZ2;
else else
#endif
if (strcmp((char *)"NZ", ropts) == 0) { if (strcmp((char *)"NZ", ropts) == 0) {
rmode = CompNone; rmode = CompNone;
#ifdef USE_EXPERIMENT
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
bp.GZwe = bp.GZthey = No; bp.GZwe = bp.GZthey = No;
#endif #endif
#ifdef HAVE_BZLIB_H #ifdef HAVE_BZLIB_H
bp.BZ2we = bp.BZ2they = No; bp.BZ2we = bp.BZ2they = No;
#endif
#endif #endif
Syslog('+', "Binkp: received NZ on M_GET command, compression turned off"); Syslog('+', "Binkp: received NZ on M_GET command, compression turned off");
} }
@ -2765,10 +2684,8 @@ void fill_binkp_list(binkp_list **bkll, file_list *fal, off_t offs)
binkp_list **tmpl; binkp_list **tmpl;
FILE *fp; FILE *fp;
struct stat tstat; struct stat tstat;
#ifdef USE_EXPERIMENT
int comp; int comp;
char *unp; char *unp;
#endif
for (tmpl = bkll; *tmpl; tmpl = &((*tmpl)->next)); for (tmpl = bkll; *tmpl; tmpl = &((*tmpl)->next));
*tmpl = (binkp_list *)malloc(sizeof(binkp_list)); *tmpl = (binkp_list *)malloc(sizeof(binkp_list));
@ -2797,7 +2714,6 @@ void fill_binkp_list(binkp_list **bkll, file_list *fal, off_t offs)
(*tmpl)->date = tstat.st_mtime; (*tmpl)->date = tstat.st_mtime;
(*tmpl)->compress = CompNone; (*tmpl)->compress = CompNone;
#ifdef USE_EXPERIMENT
/* /*
* Search compression method, but only if GZ or BZ2 compression is active. * Search compression method, but only if GZ or BZ2 compression is active.
*/ */
@ -2846,7 +2762,6 @@ void fill_binkp_list(binkp_list **bkll, file_list *fal, off_t offs)
} }
#endif #endif
Syslog('+', "Binkp: compressor select internal error"); Syslog('+', "Binkp: compressor select internal error");
#endif
} }
@ -2896,7 +2811,6 @@ void binkp_clear_filelist(int rc)
* *
*/ */
#ifdef USE_EXPERIMENT
int compress_init(int type) int compress_init(int type)
{ {
@ -3143,8 +3057,6 @@ int decompress_abort(int type, void *data)
return 0; return 0;
} }
#endif
/* /*
@ -3155,11 +3067,9 @@ int decompress_abort(int type, void *data)
void binkp_abort(void) void binkp_abort(void)
{ {
Syslog('b', "Binkp: abort"); Syslog('b', "Binkp: abort");
#ifdef USE_EXPERIMENT
if ((bp.rmode != CompNone) && z_idata) if ((bp.rmode != CompNone) && z_idata)
decompress_abort(bp.rmode, z_idata); decompress_abort(bp.rmode, z_idata);
if ((bp.tmode != CompNone) && z_odata) if ((bp.tmode != CompNone) && z_odata)
compress_abort(bp.tmode, z_odata); compress_abort(bp.tmode, z_odata);
#endif
} }