From c62614ef84aaaa53d0b60ed3ef3f69cb0935d151 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Wed, 28 Jan 2004 21:10:56 +0000 Subject: [PATCH] code cleanup --- TODO | 5 +- lib/dbdupe.c | 9 +-- lib/dbuser.c | 4 +- lib/mangle.c | 10 +--- lib/mbdiesel.c | 3 +- lib/pktname.c | 10 +--- lib/rfcmsg.c | 5 +- lib/sectest.c | 8 +-- mbcico/dial.c | 3 +- mbcico/dietifna.c | 3 +- mbcico/emsi.c | 10 +--- mbcico/emsidat.c | 5 +- mbcico/filelist.c | 2 - mbcico/mbcico.c | 1 - mbcico/recvbark.c | 13 +---- mbcico/respfreq.c | 146 +++++++++++++++++++++++----------------------- mbcico/scanout.c | 2 +- mbcico/sendbark.c | 102 +++++++++++++++----------------- mbcico/session.c | 9 +-- mbcico/ttyio.c | 2 - mbcico/wazoo.c | 8 +-- mbcico/xmrecv.c | 14 +---- mbcico/xmsend.c | 19 ++---- mbcico/yoohoo.c | 2 +- mbcico/zmmisc.c | 8 +-- mbcico/zmsend.c | 3 +- 26 files changed, 154 insertions(+), 252 deletions(-) diff --git a/TODO b/TODO index 1e106c0e..9d67c199 100644 --- a/TODO +++ b/TODO @@ -118,11 +118,10 @@ mbfido: in the toberep database and will be multiple times announced. mbcico: - U: Fix binkp file resume when mbcico silently dies. Check with the new - driver. - L: Implement binkp option ND. + N: Implement PLZ turn off m_get command. + mbfile: L: Add a check to see if the magic filenames are (still) valid. diff --git a/lib/dbdupe.c b/lib/dbdupe.c index 12ad3060..c0373e18 100644 --- a/lib/dbdupe.c +++ b/lib/dbdupe.c @@ -4,7 +4,7 @@ * Purpose ...............: Dupe checking. * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -115,18 +115,14 @@ int CheckDupe(unsigned long crc, int idx, int max) dupes[idx].crcs[dupes[idx].count] = test; dupes[idx].count++; } - Syslog('N', "Loaded %d dupe records in %s", dupes[idx].count++, files[idx]); fclose(fil); free(dfile); dupes[idx].loaded = TRUE; dupes[idx].max = max; } - // Syslog('N', "dupetest %08x %s %d", crc, files[idx], max); - for (i = 0; i < dupes[idx].count; i++) { if (dupes[idx].crcs[i] == crc) { - // Syslog('N', "dupe at %d", i); return TRUE; } } @@ -134,7 +130,6 @@ int CheckDupe(unsigned long crc, int idx, int max) * Not a dupe, append new crc value */ dupes[idx].crcs[dupes[idx].count] = crc; - // Syslog('N', "Added new dupe at %d", dupes[idx].count); dupes[idx].count++; dupes[idx].changed = TRUE; @@ -155,7 +150,6 @@ void CloseDdb(int idx) FILE *fil; dfile = calloc(PATH_MAX, sizeof(char)); -// Syslog('N', "Checking %s.dupe", files[idx]); if (dupes[idx].loaded) { if (dupes[idx].changed) { if (dupes[idx].count > dupes[idx].max) @@ -164,7 +158,6 @@ void CloseDdb(int idx) start = 0; sprintf(dfile, "%s/etc/%s.dupe", getenv("MBSE_ROOT"), files[idx]); if ((fil = fopen(dfile, "w"))) { - Syslog('N', "Writing dupes %d to %d", start, dupes[idx].count); for (j = start; j < dupes[idx].count; j++) fwrite(&dupes[idx].crcs[j], sizeof(unsigned long), 1, fil); fclose(fil); diff --git a/lib/dbuser.c b/lib/dbuser.c index 9e5e7761..7216295b 100644 --- a/lib/dbuser.c +++ b/lib/dbuser.c @@ -1,10 +1,10 @@ /***************************************************************************** * - * $id$ + * $Id$ * Purpose ...............: Userrecord Access * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 diff --git a/lib/mangle.c b/lib/mangle.c index 5b557758..ec944bb9 100644 --- a/lib/mangle.c +++ b/lib/mangle.c @@ -4,7 +4,7 @@ * Purpose ...............: Mangle a unix name to DOS 8.3 filename * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -120,7 +120,7 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength) size_t len; if (!dest) { - Syslog('f', "ERROR: NULL dest in safe_strcpy"); + Syslog('+', "ERROR: NULL dest in safe_strcpy"); return NULL; } @@ -263,7 +263,7 @@ int is_8_3( char *fname) init_chartest(); for (i = 0; i < strlen(fname); i++) { if (isillegal(fname[i])) { - Syslog('f', "Illegal character in filename"); + Syslog('+', "Illegal character in filename"); return FALSE; } } @@ -378,7 +378,6 @@ void mangle_name_83(char *s) for (i = 0; i < strlen(q); i++) *p++ = q[i]; *p++ = '\0'; -// Syslog('f', "name with new extension => \"%s\"", s); } /* @@ -398,7 +397,6 @@ void mangle_name_83(char *s) } else { crc16 = crc16xmodem(s, strlen(s)); } -// Syslog('f', "crc16xmodem(%s) %d", s, crc16); tu(s); @@ -463,7 +461,6 @@ void name_mangle(char *OutName) */ if (!is_8_3(OutName)) { mangle_name_83(OutName); -// Syslog('f',"name_mangle(%s) ==> [%s]", p, OutName); } else { /* * No mangling needed, convert to uppercase @@ -471,7 +468,6 @@ void name_mangle(char *OutName) tu(OutName); } -// Syslog('f',"name_mangle(%s) ==> [%s]", p, OutName); free(p); } diff --git a/lib/mbdiesel.c b/lib/mbdiesel.c index da55e919..5905f847 100644 --- a/lib/mbdiesel.c +++ b/lib/mbdiesel.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS functions for TURBODIESEL * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -182,7 +182,6 @@ char *ParseMacro( const char *line, int *dieselrc) while (isspace(res[strlen(res) - 1])) { res[strlen(res) - 1] = EOS; } -// sprintf(&res[strlen(res)],"\r\n"); if ((res[0] == '@') && (res[1] =='!' )) res[0]='\0'; return res; diff --git a/lib/pktname.c b/lib/pktname.c index ed8facf3..9cc888b2 100644 --- a/lib/pktname.c +++ b/lib/pktname.c @@ -4,7 +4,7 @@ * Purpose ...............: BinkleyTerm outbound naming * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -138,7 +138,6 @@ char *pktname(faddr *addr, char flavor) q = p + strlen(p); sprintf(q, "%c%s", flavor, ptyp); - Syslog('O', "packet name is \"%s\"", p); return p; } @@ -153,7 +152,6 @@ char *floname(faddr *addr, char flavor) flavor = 'f'; q = p + strlen(p); sprintf(q, "%c%s", flavor, ftyp); - Syslog('O', "flo file name is \"%s\"", p); return p; } @@ -166,7 +164,6 @@ char *reqname(faddr *addr) p = prepbuf(addr); q = p + strlen(p); sprintf(q, "%s", rtyp); - Syslog('O', "req file name is \"%s\"", p); return p; } @@ -179,7 +176,6 @@ char *splname(faddr *addr) p = prepbuf(addr); q = p + strlen(p); sprintf(q, "%s", styp); - Syslog('O', "spl file name is \"%s\"", p); return p; } @@ -192,7 +188,6 @@ char *bsyname(faddr *addr) p = prepbuf(addr); q = p + strlen(p); sprintf(q, "%s", btyp); - Syslog('O', "bsy file name is \"%s\"", p); return p; } @@ -205,7 +200,6 @@ char *stsname(faddr *addr) p = prepbuf(addr); q = p + strlen(p); sprintf(q, "%s", qtyp); - Syslog('O', "sts file name is \"%s\"", p); return p; } @@ -218,7 +212,6 @@ char *polname(faddr *addr) p = prepbuf(addr); q = p + strlen(p); sprintf(q, "%s", ltyp); - Syslog('O', "pol file name is \"%s\"", p); return p; } @@ -286,7 +279,6 @@ char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat) } tidy_faddr(bestaka); - Syslog('O', "Arc file name is \"%s\"", buf); return buf; } diff --git a/lib/rfcmsg.c b/lib/rfcmsg.c index 2b62b119..ee727126 100644 --- a/lib/rfcmsg.c +++ b/lib/rfcmsg.c @@ -4,7 +4,7 @@ * Purpose ...............: RFC msg * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -79,7 +79,6 @@ rfcmsg *parsrfc(FILE *fp) } else cur->val = xstrcat(cur->val,buffer); } else { -// Syslog('M', "this is a header line"); if (cur) { firstline=FALSE; (cur->next) = (rfcmsg *)malloc(sizeof(rfcmsg)); @@ -101,7 +100,6 @@ rfcmsg *parsrfc(FILE *fp) /* at least one non blank char */ (strspn(p+2, " \t\n") < strlen(p+2)) && (strspn(buffer,KWDCHARS) == (p-buffer))) { *p='\0'; -// Syslog('M', "This is a regular header"); cur->key = xstrcpy(buffer); cur->val = xstrcpy(p+1); } else if ((p=strchr(buffer,':')) && (!strncasecmp(buffer, (char *)"X-MS-", 5))) { @@ -124,7 +122,6 @@ rfcmsg *parsrfc(FILE *fp) cur->key = xstrcpy(buffer); cur->val = xstrcpy((char *)" "); } else { - Syslog('M', "Non-header line: \"%s\"",buffer); cur->key = xstrcpy((char *)"X-Body-Start"); cur->val = xstrcpy(buffer); break; diff --git a/lib/sectest.c b/lib/sectest.c index 905493cc..78f282eb 100644 --- a/lib/sectest.c +++ b/lib/sectest.c @@ -4,7 +4,7 @@ * Purpose ...............: Security flags access test * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -40,9 +40,6 @@ */ int Access(securityrec us, securityrec ref) { - Syslog('B', "User %5d %08lx %08lx", us.level, us.flags, ~us.flags); - Syslog('B', "Ref. %5d %08lx %08lx", ref.level, ref.flags, ref.notflags); - if (us.level < ref.level) return FALSE; @@ -63,9 +60,6 @@ int Access(securityrec us, securityrec ref) */ int Le_Access(securityrec us, securityrec ref) { - Syslog('B', "User %5d %08lx %08lx", us.level, us.flags, ~us.flags); - Syslog('B', "Ref. %5d %08lx %08lx", le_int(ref.level), ref.flags, ref.notflags); - if (us.level < le_int(ref.level)) return FALSE; diff --git a/mbcico/dial.c b/mbcico/dial.c index 2c33dd97..39642caf 100644 --- a/mbcico/dial.c +++ b/mbcico/dial.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -155,7 +155,6 @@ int hangup() void aftercall() { - Syslog('d', "Reading link stat (aftercall)"); FLUSHIN(); FLUSHOUT(); chat(modem.info, CFG.timeoutreset, TRUE, NULL); diff --git a/mbcico/dietifna.c b/mbcico/dietifna.c index 30e8195e..ad5b0762 100644 --- a/mbcico/dietifna.c +++ b/mbcico/dietifna.c @@ -132,8 +132,7 @@ int sendfiles(file_list *tosend) while (((c = GETCHAR(15)) >= 0) && (c != NAK) && (c != 'C') && (count++ < 9)) - Syslog('s', "got '%s' waiting for C/NAK", - printablec(c)); + Syslog('s', "got '%s' waiting for C/NAK", printablec(c)); if (c == NAK) session_flags &= ~FTSC_XMODEM_CRC; diff --git a/mbcico/emsi.c b/mbcico/emsi.c index fdf95970..50b12845 100644 --- a/mbcico/emsi.c +++ b/mbcico/emsi.c @@ -306,7 +306,6 @@ SM_START(init) SM_STATE(init) - Syslog('i', "RXEMSI: init"); gpt_resettimers(); gpt_settimer(0, 60); gpt_settimer(1, 20); @@ -314,7 +313,6 @@ SM_STATE(init) SM_STATE(waitpkt) - Syslog('i', "RXEMSI: waitpkt"); standby = 0; gpt_settimer(1, 20); SM_PROCEED(waitchar); @@ -410,8 +408,6 @@ SM_STATE(getdat) SM_STATE(checkpkt) - Syslog('i', "RXEMSI: checkpkt"); - if (strncasecmp(databuf,"EMSI_DAT",8) == 0) { SM_PROCEED(checkdat); } @@ -483,13 +479,12 @@ SM_STATE(sendnak) SM_STATE(sendack) - Syslog('i', "RXEMSI: send **EMSI_ACKA490 (2 times)"); PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021"); SM_SUCCESS; SM_END - Syslog('i', "RXEMSI: end"); + free(databuf); SM_RETURN @@ -526,7 +521,6 @@ SM_EDECL Syslog('i', "TXEMSI: 60 seconds timer set"); SM_START(senddata) - Syslog('i', "TXEMSI: start"); SM_STATE(senddata) @@ -618,13 +612,11 @@ SM_STATE(checkpkt) SM_STATE(sendack) - Syslog('i', "TXEMSI: send **EMSI_ACKA490 (2 times)"); PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021"); SM_PROCEED(waitpkt); SM_END - Syslog('i', "TXEMSI: end"); SM_RETURN diff --git a/mbcico/emsidat.c b/mbcico/emsidat.c index ab1000cb..a595f4ae 100644 --- a/mbcico/emsidat.c +++ b/mbcico/emsidat.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -240,7 +240,6 @@ char *mkemsidat(int caller) sprintf(cbuf,"%04X",(unsigned int)strlen(p+12)); memcpy(p+8,cbuf,4); - Syslog('I',"Prepared: \"%s\"",p); emsiencode(NULL); /* Free memory */ return p; } @@ -340,8 +339,6 @@ int scanemsidat(char *buf) char *p, *q, *mailer_prod, *mailer_name, *mailer_version, *mailer_serial; int dupe; - Syslog('I',"got data packet: \"%s\"",buf); - p = sel_brace(buf); if (strcasecmp(p,"EMSI") != 0) { Syslog('?', "This can never occur. Got \"%s\" instead of \"EMSI\"",p); diff --git a/mbcico/filelist.c b/mbcico/filelist.c index 5c181b67..2a6a3211 100644 --- a/mbcico/filelist.c +++ b/mbcico/filelist.c @@ -477,8 +477,6 @@ file_list *create_filelist(fa_list *al, char *fl, int create) } free(temp); - - Syslog('o', "B4 FTS-0001 checkpoint"); /* * For FTS-0001 we need to create at least one packet. */ diff --git a/mbcico/mbcico.c b/mbcico/mbcico.c index 39d7e2d9..d6146be8 100644 --- a/mbcico/mbcico.c +++ b/mbcico/mbcico.c @@ -318,7 +318,6 @@ int main(int argc, char *argv[]) (strncasecmp(p,"EMSI_",5) == 0)) { master = 0; answermode = argv[optind]; - Syslog('S', "Inbound \"%s\" mode", MBSE_SS(answermode)); } else { if ((addr = parsefaddr(argv[optind]))) { immediatecall = TRUE; diff --git a/mbcico/recvbark.c b/mbcico/recvbark.c index c25c4855..c1d051b0 100644 --- a/mbcico/recvbark.c +++ b/mbcico/recvbark.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * File ..................: mbcico/recvbark.c + * $Id$ * Purpose ...............: Fidonet mailer - * Last modification date : 01-Jan-2001 * ***************************************************************************** - * Copyright (C) 1997-2001 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -88,8 +87,6 @@ SM_START(sendenq) SM_STATE(sendenq) - Syslog('s', "recvbark SENDINQ"); - count = 0; PUTCHAR(ENQ); if (STATUS) { @@ -100,8 +97,6 @@ SM_STATE(sendenq) SM_STATE(waitack) - Syslog('s', "recvbark WAITACK"); - if (count++ > 10) { Syslog('+', "Wait for Bark Request: timeout"); PUTCHAR(ETB); @@ -134,7 +129,6 @@ SM_STATE(waitack) SM_STATE(waitchar) - Syslog('s', "recvbark WAITCHAR"); c=GETCHAR(15); if (c == TIMEOUT) { Syslog('s', "Recvbark got timeout waiting for char"); @@ -157,7 +151,6 @@ SM_STATE(waitchar) SM_STATE(scanreq) - Syslog('s', "recvbark SCANREQ"); lcrc = crc16xmodem(buf, strlen(buf)); c1 = GETCHAR(15); if (c1 == TIMEOUT) { @@ -181,7 +174,6 @@ SM_STATE(scanreq) SM_STATE(sendack) - Syslog('s', "recvbark SENDACK"); count = 0; PUTCHAR(ACK); tosend = respond_bark(buf); @@ -218,7 +210,6 @@ SM_STATE(waitnak) SM_STATE(sendfiles) - Syslog('s', "recvbark SENDFILES"); rc = xmsndfiles(tosend); tidy_filelist(tosend, 0); if (rc == 0) { diff --git a/mbcico/respfreq.c b/mbcico/respfreq.c index c01a9740..6cdf79e3 100644 --- a/mbcico/respfreq.c +++ b/mbcico/respfreq.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer - respond to filerequests * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -66,91 +66,90 @@ static int no_more = FALSE; file_list *respond_wazoo(void) { - char buf[256]; - char *nm, *pw, *dt, *p; - file_list *fl=NULL, **tmpl; - FILE *fp; + char buf[256], *nm, *pw, *dt, *p; + file_list *fl=NULL, **tmpl; + FILE *fp; - if (freqname == NULL) - return NULL; + if (freqname == NULL) + return NULL; - if ((fp=fopen(freqname,"r")) == NULL) { - WriteError("$cannot open received wazoo freq \"%s\"",freqname); - unlink(freqname); - free(freqname); - freqname=NULL; - return NULL; - } - - tmpl=&fl; - while (fgets(buf,sizeof(buf)-1,fp)) { - nm = NULL; - pw = NULL; - dt = NULL; - p = strtok(buf," \n\r"); - if ((p == NULL) || (*p == '\0')) - continue; - nm = p; - p = strtok(NULL," \n\r"); - if (p && (*p == '!')) - pw = p+1; - else - if (p && ((*p == '+') || (*p == '-'))) - dt = p; - p = strtok(NULL," \n\r"); - if (p && (*p == '!')) - pw = p+1; - else - if (p && ((*p == '+') || (*p == '-'))) - dt = p; - *tmpl = respfreq(nm, pw, dt); - while (*tmpl) tmpl=&((*tmpl)->next); - if (no_more) - break; - } - - fclose(fp); + if ((fp=fopen(freqname,"r")) == NULL) { + WriteError("$cannot open received wazoo freq \"%s\"",freqname); unlink(freqname); free(freqname); - freqname = NULL; - for (tmpl = &fl; *tmpl; tmpl = &((*tmpl)->next)) { - Syslog('F', "resplist: %s",MBSE_SS((*tmpl)->local)); - } - attach_report(&fl); - return fl; + freqname=NULL; + return NULL; + } + + tmpl=&fl; + while (fgets(buf,sizeof(buf)-1,fp)) { + nm = NULL; + pw = NULL; + dt = NULL; + p = strtok(buf," \n\r"); + if ((p == NULL) || (*p == '\0')) + continue; + nm = p; + p = strtok(NULL," \n\r"); + if (p && (*p == '!')) + pw = p+1; + else if (p && ((*p == '+') || (*p == '-'))) + dt = p; + p = strtok(NULL," \n\r"); + if (p && (*p == '!')) + pw = p+1; + else if (p && ((*p == '+') || (*p == '-'))) + dt = p; + + *tmpl = respfreq(nm, pw, dt); + while (*tmpl) tmpl=&((*tmpl)->next); + if (no_more) + break; + } + + fclose(fp); + unlink(freqname); + free(freqname); + freqname = NULL; + for (tmpl = &fl; *tmpl; tmpl = &((*tmpl)->next)) { + Syslog('f', "resplist: %s",MBSE_SS((*tmpl)->local)); + } + attach_report(&fl); + return fl; } file_list *respond_bark(char *buf) { - char *nm, *pw, *dt, *p; - file_list *fl; + char *nm, *pw, *dt, *p; + file_list *fl; - nm = buf; - pw = (char *)""; - dt = (char *)"0"; - while (isspace(*nm)) - nm++; - for (p = nm; *p && (!isspace(*p)); p++); + nm = buf; + pw = (char *)""; + dt = (char *)"0"; + while (isspace(*nm)) + nm++; + for (p = nm; *p && (!isspace(*p)); p++); + if (*p) { + *p++ = '\0'; + dt = p; + while (isspace(*dt)) + dt++; + for (p = dt; *p && (!isspace(*p)); p++); if (*p) { - *p++ = '\0'; - dt = p; - while (isspace(*dt)) - dt++; - for (p = dt; *p && (!isspace(*p)); p++); - if (*p) { - *p++ = '\0'; - pw = p; - while (isspace(*pw)) - pw++; - for (p = pw; *p && (!isspace(*p)); p++); - *p = '\0'; - } + *p++ = '\0'; + pw = p; + while (isspace(*pw)) + pw++; + for (p = pw; *p && (!isspace(*p)); p++); + *p = '\0'; } - fl = respfreq(nm, pw, dt); - attach_report(&fl); - return fl; + } + + fl = respfreq(nm, pw, dt); + attach_report(&fl); + return fl; } @@ -612,7 +611,6 @@ static void attach_report(file_list **fl) records = (ftell(fp) - olhdr.hdrsize) / olhdr.recsize; srand(getpid()); recno = 1+(int) (1.0 * records * rand() / (RAND_MAX + 1.0)); - Syslog('f', "Selected quote %d out of %d records", recno, records); if (fseek(fp, olhdr.hdrsize + (recno * olhdr.recsize), SEEK_SET) == 0) { if (fread(&ol, olhdr.recsize, 1, fp) == 1) { add_report((char *)"\r... %s", ol.Oneline); diff --git a/mbcico/scanout.c b/mbcico/scanout.c index a2a43db3..9b73cf76 100644 --- a/mbcico/scanout.c +++ b/mbcico/scanout.c @@ -63,7 +63,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo Syslog('o' ,"scan_dir \"%s\" (%s)",MBSE_SS(dname),ispoint?"point":"node"); if ((dp = opendir(dname)) == NULL) { - Syslog('-', "Creating directory %s", dname); + Syslog('+', "Creating directory %s", dname); /* * Create a fake filename, mkdirs() likes that. */ diff --git a/mbcico/sendbark.c b/mbcico/sendbark.c index 355dff8b..1970c06e 100644 --- a/mbcico/sendbark.c +++ b/mbcico/sendbark.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * File ..................: mbcico/sendbark.c + * $Id$ * Purpose ...............: Fidonet mailer - * Last modification date : 29-Oct-2000 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -114,73 +113,68 @@ int sendbark(void) SM_DECL(send_bark,(char *)"sendbark") SM_STATES - Send, - waitack, - getfile + Send, + waitack, + getfile SM_NAMES - (char *)"send", - (char *)"waitack", - (char *)"getfile" + (char *)"send", + (char *)"waitack", + (char *)"getfile" SM_EDECL - int c; - char buf[256]; - unsigned short crc; - int count = 0; + char buf[256]; + unsigned short crc; + int c, count = 0; - Syslog('s', "send_bark INIT"); - sprintf(buf,"%s %s %s",nm,dt,pw); - crc = crc16xmodem(buf, strlen(buf)); - Syslog('s', "sending bark packet \"%s\", crc = 0x%04x", buf, crc); + sprintf(buf,"%s %s %s",nm,dt,pw); + crc = crc16xmodem(buf, strlen(buf)); + Syslog('s', "sending bark packet \"%s\", crc = 0x%04x", buf, crc); SM_START(Send) SM_STATE(Send) - Syslog('s', "send_bark SEND"); - if (count++ > 5) { - Syslog('+', "Bark request failed"); - SM_ERROR; - } + if (count++ > 5) { + Syslog('+', "Bark request failed"); + SM_ERROR; + } - PUTCHAR(ACK); - PUT(buf, strlen(buf)); - PUTCHAR(ETX); - PUTCHAR(crc & 0xff); - PUTCHAR((crc >> 8) & 0xff); - if (STATUS) { - SM_ERROR; - } else { - SM_PROCEED(waitack); - } + PUTCHAR(ACK); + PUT(buf, strlen(buf)); + PUTCHAR(ETX); + PUTCHAR(crc & 0xff); + PUTCHAR((crc >> 8) & 0xff); + if (STATUS) { + SM_ERROR; + } else { + SM_PROCEED(waitack); + } SM_STATE(waitack) - Syslog('s', "send_bark WAITACK"); - c = GETCHAR(10); - if (c == TIMEOUT) { - Syslog('s', "sendbark got timeout waiting for ACK"); - SM_PROCEED(Send); - } else if (c < 0) { - SM_PROCEED(Send); - } else if (c == ACK) { - SM_PROCEED(getfile); - } else { - Syslog('s', "sendbark got %s waiting for ACK", printablec(c)); - SM_PROCEED(Send); - } + c = GETCHAR(10); + if (c == TIMEOUT) { + Syslog('s', "sendbark got timeout waiting for ACK"); + SM_PROCEED(Send); + } else if (c < 0) { + SM_PROCEED(Send); + } else if (c == ACK) { + SM_PROCEED(getfile); + } else { + Syslog('s', "sendbark got %s waiting for ACK", printablec(c)); + SM_PROCEED(Send); + } SM_STATE(getfile) - Syslog('s', "send_bark GETFILE"); - switch (xmrecv(NULL)) { - case 0: SM_PROCEED(getfile); - break; - case 1: SM_SUCCESS; - break; - default: SM_ERROR; - break; - } + switch (xmrecv(NULL)) { + case 0: SM_PROCEED(getfile); + break; + case 1: SM_SUCCESS; + break; + default: SM_ERROR; + break; + } SM_END SM_RETURN diff --git a/mbcico/session.c b/mbcico/session.c index 56efb8ee..1d040b50 100644 --- a/mbcico/session.c +++ b/mbcico/session.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -229,7 +229,6 @@ SM_START(skipjunk) SM_STATE(skipjunk) - Syslog('s', "tx_define_type SKIPJUNK"); while ((c = GETCHAR(1)) >= 0) /*nothing*/ ; if (c == TIMEOUT) { gpt_resettimers(); @@ -241,7 +240,6 @@ SM_STATE(skipjunk) SM_STATE(wake) - Syslog('s', "tx_define_type WAKE"); if (gpt_expired(0)) { Syslog('+', "Remote did not respond"); SM_ERROR; @@ -256,7 +254,6 @@ SM_STATE(wake) SM_ERROR; } else { gpt_settimer(0, 60); - Syslog('S', "Got %c wakeup", c); SM_PROCEED(nextchar); } @@ -364,17 +361,13 @@ SM_STATE(checkintro) SM_STATE(sendinq) - Syslog('s', "tx_define_type SENDINQ"); PUTCHAR(DC1); if ((localoptions & NOEMSI) == 0) { - Syslog('S', "send **EMSI_INQC816 (2 times)"); PUTSTR((char *)"\r**EMSI_INQC816\r**EMSI_INQC816"); } if ((localoptions & NOWAZOO) == 0) { - Syslog('S', "send YOOHOO char"); PUTCHAR(YOOHOO); } - Syslog('S', "send TSYNC char"); PUTCHAR(TSYNC); if ((localoptions & NOEMSI) == 0) PUTSTR((char *)"\r\021"); diff --git a/mbcico/ttyio.c b/mbcico/ttyio.c index 1a898bcb..a0081fdd 100644 --- a/mbcico/ttyio.c +++ b/mbcico/ttyio.c @@ -172,8 +172,6 @@ static int tty_read(char *buf, int size, int tot) fd_set readfds, writefds, exceptfds; struct timeval seltimer; -// Syslog('t', "tty_read(buf, %d, %d)", size, tot); - if (size == 0) return 0; tty_status = 0; diff --git a/mbcico/wazoo.c b/mbcico/wazoo.c index 9f85bf66..a127ceeb 100644 --- a/mbcico/wazoo.c +++ b/mbcico/wazoo.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2002 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -104,10 +104,8 @@ int txwazoo(void) char *nonhold_mail; Syslog('+', "Start WaZOO session"); -// if (localoptions & NOHOLD) - nonhold_mail = (char *)ALL_MAIL; -// else -// nonhold_mail = (char *)NONHOLD_MAIL; + nonhold_mail = (char *)ALL_MAIL; + if (emsi_remote_lcodes & LCODE_HAT) { Syslog('+', "Remote asked to \"hold all traffic\", no send"); tosend = NULL; diff --git a/mbcico/xmrecv.c b/mbcico/xmrecv.c index 71a68ab7..fc812eb4 100644 --- a/mbcico/xmrecv.c +++ b/mbcico/xmrecv.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -149,7 +149,6 @@ SM_EDECL off_t remsize=0; int goteot = FALSE; - Syslog('x', "xmrecv INIT"); gettimeofday(&starttime, &tz); recv_blk=-1L; @@ -181,7 +180,6 @@ SM_STATE(sendnak0) SM_STATE(waitblk0) - Syslog('x', "xmrecv WAITBLK0"); header = GETCHAR(5); if (header == TIMEOUT) { Syslog('x', "timeout waiting for xmodem block 0 header, count=%d", count); @@ -248,7 +246,6 @@ SM_STATE(waitblk0) SM_STATE(sendnak) - Syslog('x', "xmrecv SENDNAK"); if (ackd_blk < 0) { SM_PROCEED(sendnak0); } @@ -306,7 +303,6 @@ SM_STATE(sendack) SM_STATE(waitblk) - Syslog('x', "xmrecv WAITBLK"); header = GETCHAR(15); if (header == TIMEOUT) { Syslog('x', "timeout waiting for xmodem block header, count=%d", count); @@ -344,7 +340,6 @@ SM_STATE(waitblk) SM_STATE(recvblk) - Syslog('x', "xmrecv RECVBLK"); Nopper(); GET((char*)&xmblk,(crcmode && (header != SYN))? sizeof(xmblk): sizeof(xmblk)-1,15); if (STATUS == STAT_TIMEOUT) { @@ -442,8 +437,7 @@ SM_STATE(recvblk) SM_STATE(checktelink) - Syslog('x', "xmrecv CHECKTELINK"); - Syslog('X', "checktelink got \"%s\"",printable(xmblk.data,45)); + Syslog('x', "checktelink got \"%s\"",printable(xmblk.data,45)); if (tmpfname[0] == '\0') { strncpy(tmpfname,xmblk.data+8,16); /* @@ -457,7 +451,7 @@ SM_STATE(checktelink) } } else { Syslog('+', "Remote uses %s",printable(xmblk.data+25,-14)); - Syslog('X', "Remote file name \"%s\" discarded", printable(xmblk.data+8,-16)); + Syslog('x', "Remote file name \"%s\" discarded", printable(xmblk.data+8,-16)); } remsize = ((off_t)xmblk.data[0]) + ((off_t)xmblk.data[1]<<8) + ((off_t)xmblk.data[2]<<16) + ((off_t)xmblk.data[3]<<24); last_blk = (remsize-1)/XMBLKSIZ+1; @@ -518,7 +512,6 @@ SM_STATE(checktelink) SM_STATE(recvm7) - Syslog('x', "xmrecv RECVM7"); switch (m7recv(tmpfname)) { case 0: ackd_blk=0; SM_PROCEED(sendnak); @@ -531,7 +524,6 @@ SM_STATE(recvm7) SM_STATE(goteof) - Syslog('x', "xmrecv GOTEOF"); Slo = FALSE; closeit(1); if (ackd_blk == -1L) diff --git a/mbcico/xmsend.c b/mbcico/xmsend.c index 6f8b0568..0fe8232c 100644 --- a/mbcico/xmsend.c +++ b/mbcico/xmsend.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2001 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -124,7 +124,6 @@ SM_EDECL fl.l_start=0L; fl.l_len=0L; - Syslog('x', "xmsend INIT"); gettimeofday(&starttime, &tz); /* if we got 'C' than hopefully remote is sealink capable... */ @@ -185,7 +184,6 @@ SM_START(startstate) SM_STATE(sendm7) - Syslog('x', "xmsend SENDM7"); if (m7send(rn)) { SM_PROCEED(sendblk0); } else { @@ -194,7 +192,6 @@ SM_STATE(sendm7) SM_STATE(sendblk0) - Syslog('X', "xmsend SENDBLK0"); Syslog('x', "xmsendblk0 send:%ld, next:%ld, ackd:%ld, last:%ld", send_blk,next_blk,ackd_blk,last_blk); memset(xmblk.data,0,sizeof(xmblk.data)); @@ -217,22 +214,20 @@ SM_STATE(sendblk0) xmblk.data[41]=((session_flags & FTSC_XMODEM_RES) != 0); xmblk.data[42]=((session_flags & FTSC_XMODEM_XOF) != 0); - Syslog('X', "sealink block: \"%s\"",printable(xmblk.data,44)); + Syslog('x', "sealink block: \"%s\"",printable(xmblk.data,44)); next_blk=send_blk+1; SM_PROCEED(sendblk); SM_STATE(sendblk) - Syslog('X', "xmsend SENDBLK %d", send_blk); + Syslog('x', "xmsendblk send:%ld, next:%ld, ackd:%ld, last:%ld", send_blk,next_blk,ackd_blk,last_blk); if (send_blk == 0) { SM_PROCEED(writeblk); } - Syslog('x', "xmsendblk send:%ld, next:%ld, ackd:%ld, last:%ld", send_blk,next_blk,ackd_blk,last_blk); - if (send_blk > last_blk) { - Syslog('X', "send_blk > last_blk"); + Syslog('x', "send_blk > last_blk"); if (send_blk == (last_blk+1)) { SM_PROCEED(sendeot); } else if (ackd_blk < last_blk) { @@ -264,7 +259,6 @@ SM_STATE(sendblk) SM_STATE(writeblk) - Syslog('X', "xmsend WRITEBLK"); Nopper(); xmblk.n1=send_blk&0xff; xmblk.n2=~xmblk.n1; @@ -290,7 +284,6 @@ SM_STATE(writeblk) SM_STATE(waitack) - Syslog('x', "xmsend WAITACK"); if ((count > 4) && (ackd_blk < 0)) { Syslog('+', "Cannot send sealink block, try xmodem"); window=1; @@ -309,7 +302,6 @@ SM_STATE(waitack) } a = GETCHAR(20); - Syslog('X', "xmsend got 0x%02x", a); if (a == TIMEOUT) { if (count++ > 9) { Syslog('+', "too many tries to send block"); @@ -356,7 +348,6 @@ SM_STATE(waitack) case 1: a1=GETCHAR(1); a2=GETCHAR(1); - Syslog('X', "got block ACK %d", a1); if ((a1 < 0) || (a2 < 0) || (a1 != ((~a2)&0xff))) { Syslog('x', "bad ACK: 0x%02x/0x%02x, ignore", a1,a2); SM_PROCEED(sendblk); @@ -417,7 +408,6 @@ SM_STATE(waitack) SM_STATE(resync) - Syslog('x', "xmsend RESYNC"); if (count++ > 9) { Syslog('+', "too may tries to resync"); SM_ERROR; @@ -464,7 +454,6 @@ SM_STATE(resync) SM_STATE(sendeot) - Syslog('x', "xmsend SENDEOT"); PUTCHAR(EOT); if (STATUS) { SM_ERROR; diff --git a/mbcico/yoohoo.c b/mbcico/yoohoo.c index 63ecc2e0..d817c1f2 100644 --- a/mbcico/yoohoo.c +++ b/mbcico/yoohoo.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 diff --git a/mbcico/zmmisc.c b/mbcico/zmmisc.c index 3e4b25ff..855e3baa 100644 --- a/mbcico/zmmisc.c +++ b/mbcico/zmmisc.c @@ -1,4 +1,6 @@ /* + * $Id$ + * * Z M . C * Copyright 1994 Omen Technology Inc All Rights Reserved * ZMODEM protocol primitives @@ -712,20 +714,16 @@ int zrbhd32(register char *shdr) Rxtype = c; crc = 0xFFFFFFFFL; crc = updcrc32(c, crc); - Syslog('Z', "zrbhd32 c=%X crc=%lX", c, crc); - for (n=Rxhlen; --n >= 0; ++shdr) { if ((c = zdlread()) & ~0377) return c; crc = updcrc32(c, crc); *shdr = c; - Syslog('Z', "zrbhd32 c=%X crc=%lX", c, crc); } for (n=4; --n >= 0;) { if ((c = zdlread()) & ~0377) return c; crc = updcrc32(c, crc); - Syslog('Z', "zrbhd32 c=%X crc=%lX", c, crc); } if (crc != 0xDEBB20E3) { Syslog('+', "Zmodem zrbhd32: Bad CRC"); @@ -791,7 +789,6 @@ void zputhex(register int c) { static char digits[] = "0123456789abcdef"; - Syslog('Z', "zputhex: %02X", c); BUFFER_BYTE(digits[(c&0xF0)>>4]); BUFFER_BYTE(digits[(c)&0xF]); } @@ -847,7 +844,6 @@ int zgethex(void) register int c; c = zgeth1(); - Syslog('Z', "zgethex: %02X", c); return c; } diff --git a/mbcico/zmsend.c b/mbcico/zmsend.c index 39924a9a..43ac7b51 100644 --- a/mbcico/zmsend.c +++ b/mbcico/zmsend.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2001 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -399,7 +399,6 @@ again: lastcrcrq = Rxpos; crc = 0xFFFFFFFFL; fseek(in, 0L, 0); - Syslog('Z', "bytcnt=%ld crc=%08lX", bytcnt, crc); while (((c = getc(in)) != EOF) && --lastcrcrq) crc = updcrc32(c, crc); crc = ~crc;