diff --git a/src/sbbs3/rechocfg.c b/src/sbbs3/rechocfg.c index 0551fdb9aef36c6fbbd48c6082571d4fc111522c..b506da54f97c3bd4a69d7e66706bcef75406135b 100644 --- a/src/sbbs3/rechocfg.c +++ b/src/sbbs3/rechocfg.c @@ -8,7 +8,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2012 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2014 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -203,6 +203,7 @@ void read_echo_cfg() cfg.log_level=LOG_INFO; cfg.check_path=TRUE; cfg.zone_blind=FALSE; + cfg.zone_blind_threshold=0xffff; SAFECOPY(cfg.sysop_alias,"SYSOP"); while(1) { @@ -273,6 +274,8 @@ void read_echo_cfg() if(!stricmp(tmp,"ZONE_BLIND")) { cfg.zone_blind=TRUE; + if(*p && isdigit(*p)) /* threshold specified (zones > this threshold will be treated normally/separately) */ + cfg.zone_blind_threshold=atoi(p); continue; } diff --git a/src/sbbs3/sbbsecho.c b/src/sbbs3/sbbsecho.c index 88e6f8749fbdd564bc4e1cbe6aaff869333460ea..a71f0d3e2c2d4a726069b45e6804ac70dfb124d4 100644 --- a/src/sbbs3/sbbsecho.c +++ b/src/sbbs3/sbbsecho.c @@ -2682,6 +2682,12 @@ char *pktname(BOOL temp) } return(NULL); /* This should never happen */ } + +BOOL zone_blind(uint16_t zone) +{ + return cfg.zone_blind && zone <= cfg.zone_blind_threshold; +} + /****************************************************************************** This function puts a message into a Fido packet, writing both the header information and the message body @@ -2743,13 +2749,13 @@ void putfmsg(FILE *stream,char *fbuf,fmsghdr_t fmsghdr,areasbbs_t area } if(area.name) { /* EchoMail, Not NetMail */ - if(!cfg.zone_blind && addr.zone!=fmsghdr.destzone) /* Zone Gate */ + if(!zone_blind(fmsghdr.destzone) && addr.zone!=fmsghdr.destzone) /* Zone Gate */ fprintf(stream,"SEEN-BY: %d/%d\r",fmsghdr.destnet,fmsghdr.destnode); else { fprintf(stream,"SEEN-BY:"); for(i=0;i<seenbys.addrs;i++) { /* Put back original SEEN-BYs */ strcpy(seenby," "); - if(!cfg.zone_blind && seenbys.addr[i].zone!=addr.zone) + if(!zone_blind(seenbys.addr[i].zone) && seenbys.addr[i].zone!=addr.zone) continue; if(seenbys.addr[i].net!=addr.net || !net_exists) { net_exists=1; @@ -2776,7 +2782,7 @@ void putfmsg(FILE *stream,char *fbuf,fmsghdr_t fmsghdr,areasbbs_t area if(node<cfg.nodecfgs && (cfg.nodecfg[node].attr&ATTR_PASSIVE)) continue; strcpy(seenby," "); - if((!cfg.zone_blind && area.uplink[i].zone!=addr.zone) || area.uplink[i].point) + if((!zone_blind(area.uplink[i].zone) && area.uplink[i].zone!=addr.zone) || area.uplink[i].point) continue; for(j=0;j<seenbys.addrs;j++) if(!memcmp(&area.uplink[i],&seenbys.addr[j],sizeof(faddr_t))) @@ -2805,7 +2811,7 @@ void putfmsg(FILE *stream,char *fbuf,fmsghdr_t fmsghdr,areasbbs_t area for(i=0;i<scfg.total_faddrs;i++) { /* Add AKAs to SEEN-BYs */ strcpy(seenby," "); - if((!cfg.zone_blind && scfg.faddr[i].zone!=addr.zone) || scfg.faddr[i].point) + if((!zone_blind(scfg.faddr[i].zone) && scfg.faddr[i].zone!=addr.zone) || scfg.faddr[i].point) continue; for(j=0;j<seenbys.addrs;j++) if(!memcmp(&scfg.faddr[i],&seenbys.addr[j],sizeof(faddr_t))) @@ -2837,7 +2843,7 @@ void putfmsg(FILE *stream,char *fbuf,fmsghdr_t fmsghdr,areasbbs_t area addr=getsysfaddr(fmsghdr.destzone); for(i=0;i<paths.addrs;i++) { /* Put back the original PATH */ strcpy(seenby," "); - if((!cfg.zone_blind && paths.addr[i].zone!=addr.zone) || paths.addr[i].point) + if((!zone_blind(paths.addr[i].zone) && paths.addr[i].zone!=addr.zone) || paths.addr[i].point) continue; if(paths.addr[i].net!=addr.net || !net_exists) { net_exists=1; @@ -3057,7 +3063,7 @@ BOOL check_psb(addrlist_t* addrlist, faddr_t compaddr) int i; for(i=0;i<addrlist->addrs;i++) { - if(!cfg.zone_blind && compaddr.zone != addrlist->addr[i].zone) + if(!zone_blind(addrlist->addr[i].zone) && compaddr.zone != addrlist->addr[i].zone) continue; if(compaddr.net != addrlist->addr[i].net) continue; diff --git a/src/sbbs3/sbbsecho.h b/src/sbbs3/sbbsecho.h index c1b395b9b75884d8d9e9769050564011f6289a38..ed001efe864cc328ba111dc8f8ed8fe443e60fb3 100644 --- a/src/sbbs3/sbbsecho.h +++ b/src/sbbs3/sbbsecho.h @@ -38,7 +38,7 @@ /* Portions written by Allen Christiansen 1994-1996 */ #define SBBSECHO_VERSION_MAJOR 2 -#define SBBSECHO_VERSION_MINOR 25 +#define SBBSECHO_VERSION_MINOR 26 #define SBBSECHO_PRODUCT_CODE 0x12FF /* from http://ftsc.org/docs/ftscprod.013 */ @@ -242,6 +242,7 @@ typedef struct { areasbbs_t *area; /* Each area configuration */ BOOL check_path; /* Enable circular path detection */ BOOL zone_blind; /* Pretend zones don't matter when parsing and constructing PATH and SEEN-BY lines (per Wilfred van Velzen, 2:280/464) */ + uint16_t zone_blind_threshold; /* Zones below this number (e.g. 4) will be treated as the same zone when zone_blind is enabled */ } config_t; #ifdef __WATCOMC__