Implemented No PLZ, No GZ/BZ2 options per node

This commit is contained in:
Michiel Broek
2005-07-03 20:32:21 +00:00
parent f28946679c
commit 180632b4c6
5 changed files with 130 additions and 78 deletions

View File

@@ -256,14 +256,23 @@ int binkp(int role)
bp.msgs_on_queue = 0;
bp.cmpblksize = SND_BLKSIZE;
#ifdef HAVE_ZLIB_H
bp.PLZflag = WeCan;
if (localoptions & NOPLZ)
bp.PLZflag = No;
else
bp.PLZflag = WeCan;
bp.z_obuf = calloc(MAX_BLKSIZE + 3, sizeof(unsigned char));
bp.GZflag = WeCan;
if (localoptions & NOGZBZ2)
bp.GZflag = No;
else
bp.GZflag = WeCan;
#else
bp.PLZflag = No;
#endif
#ifdef HAVE_BZLIB_H
bp.BZ2flag = WeCan;
if (localoptions & NOGZBZ2)
bp.BZ2flag = No;
else
bp.BZ2flag = WeCan;
#endif
bp.buggyIrex = FALSE;
@@ -1945,14 +1954,22 @@ int binkp_banner(void)
* Send extra options
*/
if (!rc) {
p = xstrcpy((char *)"OPT EXTCMD");
if (localoptions & NOGZBZ2)
p = xstrcpy((char *)"OPT");
else
p = xstrcpy((char *)"OPT EXTCMD");
#ifdef HAVE_BZLIB_H
p = xstrcat(p, (char *)" BZ2");
if (! (localoptions & NOGZBZ2))
p = xstrcat(p, (char *)" BZ2");
#endif
#ifdef HAVE_ZLIB_H
p = xstrcat(p, (char *)" GZ PLZ");
if (! (localoptions & NOPLZ))
p = xstrcat(p, (char *)" PLZ");
if (! (localoptions & NOGZBZ2))
p = xstrcat(p, (char *)" GZ");
#endif
rc = binkp_send_command(MM_NUL,"%s", p);
if (strcmp(p, "OPT"))
rc = binkp_send_command(MM_NUL,"%s", p);
free(p);
}

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2005
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -40,80 +40,95 @@ int localoptions;
static struct _ktab {
char *key;
int flag;
char *key;
int flag;
} ktab[] = {
{(char *)"Call", NOCALL},
{(char *)"WaZOO", NOWAZOO},
{(char *)"EMSI", NOEMSI},
{(char *)"Freqs", NOFREQS},
{(char *)"Zmodem", NOZMODEM},
{(char *)"ZedZap", NOZEDZAP},
{(char *)"Hydra", NOHYDRA},
{NULL, 0}
{(char *)"Call", NOCALL},
{(char *)"WaZOO", NOWAZOO},
{(char *)"EMSI", NOEMSI},
{(char *)"Freqs", NOFREQS},
{(char *)"Zmodem", NOZMODEM},
{(char *)"ZedZap", NOZEDZAP},
{(char *)"Hydra", NOHYDRA},
{(char *)"PLZ", NOPLZ},
{(char *)"GZ/BZ2", NOGZBZ2},
{NULL, 0}
};
void logoptions(void)
{
int i;
char *s = NULL;
int i;
char *s = NULL;
for (i=0;ktab[i].key;i++) {
s=xstrcat(s,(char *)" ");
if (localoptions & ktab[i].flag)
s=xstrcat(s,(char *)"No");
s=xstrcat(s,ktab[i].key);
}
for (i = 0; ktab[i].key; i++) {
s = xstrcat(s, (char *)" ");
if (localoptions & ktab[i].flag)
s = xstrcat(s,(char *)"No");
s = xstrcat(s, ktab[i].key);
}
Syslog('+', "Options:%s",s);
free(s);
Syslog('+', "Options:%s",s);
free(s);
}
void rdoptions(int Loaded)
{
localoptions=0;
if (CFG.NoFreqs)
localoptions |= NOFREQS;
if (CFG.NoCall)
localoptions |= NOCALL;
if (CFG.NoEMSI)
localoptions |= NOEMSI;
if (CFG.NoWazoo)
localoptions |= NOWAZOO;
if (CFG.NoZmodem)
localoptions |= NOZMODEM;
if (CFG.NoZedzap)
localoptions |= NOZEDZAP;
if (CFG.NoHydra)
localoptions |= NOHYDRA;
localoptions = 0;
if (CFG.NoFreqs)
localoptions |= NOFREQS;
if (CFG.NoCall)
localoptions |= NOCALL;
if (CFG.NoEMSI)
localoptions |= NOEMSI;
if (CFG.NoWazoo)
localoptions |= NOWAZOO;
if (CFG.NoZmodem)
localoptions |= NOZMODEM;
if (CFG.NoZedzap)
localoptions |= NOZEDZAP;
if (CFG.NoHydra)
localoptions |= NOHYDRA;
if (nodes.Aka[0].zone == 0) {
if (Loaded)
Syslog('s', "Node not in setup, using default options");
logoptions();
return;
}
#ifndef HAVE_ZLIB_H
localoptions |= NOPLZ;
localoptions |= NOGZBZ2;
#endif
#ifndef HAVE_BZLIB_H
localoptions |= NOGZBZ2;
#endif
Syslog('s', "rdoptions node %s %s", nodes.Sysop, aka2str(nodes.Aka[0]));
if (nodes.NoEMSI)
localoptions |= NOEMSI;
if (nodes.NoWaZOO)
localoptions |= NOWAZOO;
if (nodes.NoFreqs)
localoptions |= NOFREQS;
if (nodes.NoCall)
localoptions |= NOCALL;
if (nodes.NoZmodem)
localoptions |= NOZMODEM;
if (nodes.NoZedzap)
localoptions |= NOZEDZAP;
if (nodes.NoHydra)
localoptions |= NOHYDRA;
if (nodes.Aka[0].zone == 0) {
if (Loaded)
Syslog('s', "Node not in setup, using default options");
logoptions();
return;
}
Syslog('s', "rdoptions node %s %s", nodes.Sysop, aka2str(nodes.Aka[0]));
if (nodes.NoEMSI)
localoptions |= NOEMSI;
if (nodes.NoWaZOO)
localoptions |= NOWAZOO;
if (nodes.NoFreqs)
localoptions |= NOFREQS;
if (nodes.NoCall)
localoptions |= NOCALL;
if (nodes.NoZmodem)
localoptions |= NOZMODEM;
if (nodes.NoZedzap)
localoptions |= NOZEDZAP;
if (nodes.NoHydra)
localoptions |= NOHYDRA;
if (nodes.NoPLZ)
localoptions |= NOPLZ;
if (nodes.NoGZ)
localoptions |= NOGZBZ2;
logoptions();
}

View File

@@ -60,6 +60,8 @@ extern int localoptions;
#define NOZEDZAP 0x0080
#define NOJANUS 0x0100
#define NOHYDRA 0x0200
#define NOPLZ 0x0400
#define NOGZBZ2 0x0800
struct _history history; /* History record for sessions */