code cleanup

This commit is contained in:
Michiel Broek 2004-01-28 21:10:56 +00:00
parent 861e90e2b2
commit c62614ef84
26 changed files with 154 additions and 252 deletions

5
TODO
View File

@ -118,11 +118,10 @@ mbfido:
in the toberep database and will be multiple times announced. in the toberep database and will be multiple times announced.
mbcico: mbcico:
U: Fix binkp file resume when mbcico silently dies. Check with the new
driver.
L: Implement binkp option ND. L: Implement binkp option ND.
N: Implement PLZ turn off m_get command.
mbfile: mbfile:
L: Add a check to see if the magic filenames are (still) valid. L: Add a check to see if the magic filenames are (still) valid.

View File

@ -4,7 +4,7 @@
* Purpose ...............: Dupe checking. * Purpose ...............: Dupe checking.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -115,18 +115,14 @@ int CheckDupe(unsigned long crc, int idx, int max)
dupes[idx].crcs[dupes[idx].count] = test; dupes[idx].crcs[dupes[idx].count] = test;
dupes[idx].count++; dupes[idx].count++;
} }
Syslog('N', "Loaded %d dupe records in %s", dupes[idx].count++, files[idx]);
fclose(fil); fclose(fil);
free(dfile); free(dfile);
dupes[idx].loaded = TRUE; dupes[idx].loaded = TRUE;
dupes[idx].max = max; dupes[idx].max = max;
} }
// Syslog('N', "dupetest %08x %s %d", crc, files[idx], max);
for (i = 0; i < dupes[idx].count; i++) { for (i = 0; i < dupes[idx].count; i++) {
if (dupes[idx].crcs[i] == crc) { if (dupes[idx].crcs[i] == crc) {
// Syslog('N', "dupe at %d", i);
return TRUE; return TRUE;
} }
} }
@ -134,7 +130,6 @@ int CheckDupe(unsigned long crc, int idx, int max)
* Not a dupe, append new crc value * Not a dupe, append new crc value
*/ */
dupes[idx].crcs[dupes[idx].count] = crc; dupes[idx].crcs[dupes[idx].count] = crc;
// Syslog('N', "Added new dupe at %d", dupes[idx].count);
dupes[idx].count++; dupes[idx].count++;
dupes[idx].changed = TRUE; dupes[idx].changed = TRUE;
@ -155,7 +150,6 @@ void CloseDdb(int idx)
FILE *fil; FILE *fil;
dfile = calloc(PATH_MAX, sizeof(char)); dfile = calloc(PATH_MAX, sizeof(char));
// Syslog('N', "Checking %s.dupe", files[idx]);
if (dupes[idx].loaded) { if (dupes[idx].loaded) {
if (dupes[idx].changed) { if (dupes[idx].changed) {
if (dupes[idx].count > dupes[idx].max) if (dupes[idx].count > dupes[idx].max)
@ -164,7 +158,6 @@ void CloseDdb(int idx)
start = 0; start = 0;
sprintf(dfile, "%s/etc/%s.dupe", getenv("MBSE_ROOT"), files[idx]); sprintf(dfile, "%s/etc/%s.dupe", getenv("MBSE_ROOT"), files[idx]);
if ((fil = fopen(dfile, "w"))) { if ((fil = fopen(dfile, "w"))) {
Syslog('N', "Writing dupes %d to %d", start, dupes[idx].count);
for (j = start; j < dupes[idx].count; j++) for (j = start; j < dupes[idx].count; j++)
fwrite(&dupes[idx].crcs[j], sizeof(unsigned long), 1, fil); fwrite(&dupes[idx].crcs[j], sizeof(unsigned long), 1, fil);
fclose(fil); fclose(fil);

View File

@ -1,10 +1,10 @@
/***************************************************************************** /*****************************************************************************
* *
* $id$ * $Id$
* Purpose ...............: Userrecord Access * Purpose ...............: Userrecord Access
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10

View File

@ -4,7 +4,7 @@
* Purpose ...............: Mangle a unix name to DOS 8.3 filename * Purpose ...............: Mangle a unix name to DOS 8.3 filename
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -120,7 +120,7 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength)
size_t len; size_t len;
if (!dest) { if (!dest) {
Syslog('f', "ERROR: NULL dest in safe_strcpy"); Syslog('+', "ERROR: NULL dest in safe_strcpy");
return NULL; return NULL;
} }
@ -263,7 +263,7 @@ int is_8_3( char *fname)
init_chartest(); init_chartest();
for (i = 0; i < strlen(fname); i++) { for (i = 0; i < strlen(fname); i++) {
if (isillegal(fname[i])) { if (isillegal(fname[i])) {
Syslog('f', "Illegal character in filename"); Syslog('+', "Illegal character in filename");
return FALSE; return FALSE;
} }
} }
@ -378,7 +378,6 @@ void mangle_name_83(char *s)
for (i = 0; i < strlen(q); i++) for (i = 0; i < strlen(q); i++)
*p++ = q[i]; *p++ = q[i];
*p++ = '\0'; *p++ = '\0';
// Syslog('f', "name with new extension => \"%s\"", s);
} }
/* /*
@ -398,7 +397,6 @@ void mangle_name_83(char *s)
} else { } else {
crc16 = crc16xmodem(s, strlen(s)); crc16 = crc16xmodem(s, strlen(s));
} }
// Syslog('f', "crc16xmodem(%s) %d", s, crc16);
tu(s); tu(s);
@ -463,7 +461,6 @@ void name_mangle(char *OutName)
*/ */
if (!is_8_3(OutName)) { if (!is_8_3(OutName)) {
mangle_name_83(OutName); mangle_name_83(OutName);
// Syslog('f',"name_mangle(%s) ==> [%s]", p, OutName);
} else { } else {
/* /*
* No mangling needed, convert to uppercase * No mangling needed, convert to uppercase
@ -471,7 +468,6 @@ void name_mangle(char *OutName)
tu(OutName); tu(OutName);
} }
// Syslog('f',"name_mangle(%s) ==> [%s]", p, OutName);
free(p); free(p);
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS functions for TURBODIESEL * Purpose ...............: MBSE BBS functions for TURBODIESEL
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -182,7 +182,6 @@ char *ParseMacro( const char *line, int *dieselrc)
while (isspace(res[strlen(res) - 1])) { while (isspace(res[strlen(res) - 1])) {
res[strlen(res) - 1] = EOS; res[strlen(res) - 1] = EOS;
} }
// sprintf(&res[strlen(res)],"\r\n");
if ((res[0] == '@') && (res[1] =='!' )) if ((res[0] == '@') && (res[1] =='!' ))
res[0]='\0'; res[0]='\0';
return res; return res;

View File

@ -4,7 +4,7 @@
* Purpose ...............: BinkleyTerm outbound naming * Purpose ...............: BinkleyTerm outbound naming
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -138,7 +138,6 @@ char *pktname(faddr *addr, char flavor)
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%c%s", flavor, ptyp); sprintf(q, "%c%s", flavor, ptyp);
Syslog('O', "packet name is \"%s\"", p);
return p; return p;
} }
@ -153,7 +152,6 @@ char *floname(faddr *addr, char flavor)
flavor = 'f'; flavor = 'f';
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%c%s", flavor, ftyp); sprintf(q, "%c%s", flavor, ftyp);
Syslog('O', "flo file name is \"%s\"", p);
return p; return p;
} }
@ -166,7 +164,6 @@ char *reqname(faddr *addr)
p = prepbuf(addr); p = prepbuf(addr);
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%s", rtyp); sprintf(q, "%s", rtyp);
Syslog('O', "req file name is \"%s\"", p);
return p; return p;
} }
@ -179,7 +176,6 @@ char *splname(faddr *addr)
p = prepbuf(addr); p = prepbuf(addr);
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%s", styp); sprintf(q, "%s", styp);
Syslog('O', "spl file name is \"%s\"", p);
return p; return p;
} }
@ -192,7 +188,6 @@ char *bsyname(faddr *addr)
p = prepbuf(addr); p = prepbuf(addr);
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%s", btyp); sprintf(q, "%s", btyp);
Syslog('O', "bsy file name is \"%s\"", p);
return p; return p;
} }
@ -205,7 +200,6 @@ char *stsname(faddr *addr)
p = prepbuf(addr); p = prepbuf(addr);
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%s", qtyp); sprintf(q, "%s", qtyp);
Syslog('O', "sts file name is \"%s\"", p);
return p; return p;
} }
@ -218,7 +212,6 @@ char *polname(faddr *addr)
p = prepbuf(addr); p = prepbuf(addr);
q = p + strlen(p); q = p + strlen(p);
sprintf(q, "%s", ltyp); sprintf(q, "%s", ltyp);
Syslog('O', "pol file name is \"%s\"", p);
return p; return p;
} }
@ -286,7 +279,6 @@ char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat)
} }
tidy_faddr(bestaka); tidy_faddr(bestaka);
Syslog('O', "Arc file name is \"%s\"", buf);
return buf; return buf;
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: RFC msg * Purpose ...............: RFC msg
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -79,7 +79,6 @@ rfcmsg *parsrfc(FILE *fp)
} else } else
cur->val = xstrcat(cur->val,buffer); cur->val = xstrcat(cur->val,buffer);
} else { } else {
// Syslog('M', "this is a header line");
if (cur) { if (cur) {
firstline=FALSE; firstline=FALSE;
(cur->next) = (rfcmsg *)malloc(sizeof(rfcmsg)); (cur->next) = (rfcmsg *)malloc(sizeof(rfcmsg));
@ -101,7 +100,6 @@ rfcmsg *parsrfc(FILE *fp)
/* at least one non blank char */ /* at least one non blank char */
(strspn(p+2, " \t\n") < strlen(p+2)) && (strspn(buffer,KWDCHARS) == (p-buffer))) { (strspn(p+2, " \t\n") < strlen(p+2)) && (strspn(buffer,KWDCHARS) == (p-buffer))) {
*p='\0'; *p='\0';
// Syslog('M', "This is a regular header");
cur->key = xstrcpy(buffer); cur->key = xstrcpy(buffer);
cur->val = xstrcpy(p+1); cur->val = xstrcpy(p+1);
} else if ((p=strchr(buffer,':')) && (!strncasecmp(buffer, (char *)"X-MS-", 5))) { } else if ((p=strchr(buffer,':')) && (!strncasecmp(buffer, (char *)"X-MS-", 5))) {
@ -124,7 +122,6 @@ rfcmsg *parsrfc(FILE *fp)
cur->key = xstrcpy(buffer); cur->key = xstrcpy(buffer);
cur->val = xstrcpy((char *)" "); cur->val = xstrcpy((char *)" ");
} else { } else {
Syslog('M', "Non-header line: \"%s\"",buffer);
cur->key = xstrcpy((char *)"X-Body-Start"); cur->key = xstrcpy((char *)"X-Body-Start");
cur->val = xstrcpy(buffer); cur->val = xstrcpy(buffer);
break; break;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Security flags access test * Purpose ...............: Security flags access test
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -40,9 +40,6 @@
*/ */
int Access(securityrec us, securityrec ref) 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) if (us.level < ref.level)
return FALSE; return FALSE;
@ -63,9 +60,6 @@ int Access(securityrec us, securityrec ref)
*/ */
int Le_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)) if (us.level < le_int(ref.level))
return FALSE; return FALSE;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -155,7 +155,6 @@ int hangup()
void aftercall() void aftercall()
{ {
Syslog('d', "Reading link stat (aftercall)");
FLUSHIN(); FLUSHIN();
FLUSHOUT(); FLUSHOUT();
chat(modem.info, CFG.timeoutreset, TRUE, NULL); chat(modem.info, CFG.timeoutreset, TRUE, NULL);

View File

@ -132,8 +132,7 @@ int sendfiles(file_list *tosend)
while (((c = GETCHAR(15)) >= 0) && (c != NAK) && (c != 'C') && while (((c = GETCHAR(15)) >= 0) && (c != NAK) && (c != 'C') &&
(count++ < 9)) (count++ < 9))
Syslog('s', "got '%s' waiting for C/NAK", Syslog('s', "got '%s' waiting for C/NAK", printablec(c));
printablec(c));
if (c == NAK) if (c == NAK)
session_flags &= ~FTSC_XMODEM_CRC; session_flags &= ~FTSC_XMODEM_CRC;

View File

@ -306,7 +306,6 @@ SM_START(init)
SM_STATE(init) SM_STATE(init)
Syslog('i', "RXEMSI: init");
gpt_resettimers(); gpt_resettimers();
gpt_settimer(0, 60); gpt_settimer(0, 60);
gpt_settimer(1, 20); gpt_settimer(1, 20);
@ -314,7 +313,6 @@ SM_STATE(init)
SM_STATE(waitpkt) SM_STATE(waitpkt)
Syslog('i', "RXEMSI: waitpkt");
standby = 0; standby = 0;
gpt_settimer(1, 20); gpt_settimer(1, 20);
SM_PROCEED(waitchar); SM_PROCEED(waitchar);
@ -410,8 +408,6 @@ SM_STATE(getdat)
SM_STATE(checkpkt) SM_STATE(checkpkt)
Syslog('i', "RXEMSI: checkpkt");
if (strncasecmp(databuf,"EMSI_DAT",8) == 0) { if (strncasecmp(databuf,"EMSI_DAT",8) == 0) {
SM_PROCEED(checkdat); SM_PROCEED(checkdat);
} }
@ -483,13 +479,12 @@ SM_STATE(sendnak)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('i', "RXEMSI: send **EMSI_ACKA490 (2 times)");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
SM_SUCCESS; SM_SUCCESS;
SM_END SM_END
Syslog('i', "RXEMSI: end");
free(databuf); free(databuf);
SM_RETURN SM_RETURN
@ -526,7 +521,6 @@ SM_EDECL
Syslog('i', "TXEMSI: 60 seconds timer set"); Syslog('i', "TXEMSI: 60 seconds timer set");
SM_START(senddata) SM_START(senddata)
Syslog('i', "TXEMSI: start");
SM_STATE(senddata) SM_STATE(senddata)
@ -618,13 +612,11 @@ SM_STATE(checkpkt)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('i', "TXEMSI: send **EMSI_ACKA490 (2 times)");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
SM_PROCEED(waitpkt); SM_PROCEED(waitpkt);
SM_END SM_END
Syslog('i', "TXEMSI: end");
SM_RETURN SM_RETURN

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -240,7 +240,6 @@ char *mkemsidat(int caller)
sprintf(cbuf,"%04X",(unsigned int)strlen(p+12)); sprintf(cbuf,"%04X",(unsigned int)strlen(p+12));
memcpy(p+8,cbuf,4); memcpy(p+8,cbuf,4);
Syslog('I',"Prepared: \"%s\"",p);
emsiencode(NULL); /* Free memory */ emsiencode(NULL); /* Free memory */
return p; return p;
} }
@ -340,8 +339,6 @@ int scanemsidat(char *buf)
char *p, *q, *mailer_prod, *mailer_name, *mailer_version, *mailer_serial; char *p, *q, *mailer_prod, *mailer_name, *mailer_version, *mailer_serial;
int dupe; int dupe;
Syslog('I',"got data packet: \"%s\"",buf);
p = sel_brace(buf); p = sel_brace(buf);
if (strcasecmp(p,"EMSI") != 0) { if (strcasecmp(p,"EMSI") != 0) {
Syslog('?', "This can never occur. Got \"%s\" instead of \"EMSI\"",p); Syslog('?', "This can never occur. Got \"%s\" instead of \"EMSI\"",p);

View File

@ -477,8 +477,6 @@ file_list *create_filelist(fa_list *al, char *fl, int create)
} }
free(temp); free(temp);
Syslog('o', "B4 FTS-0001 checkpoint");
/* /*
* For FTS-0001 we need to create at least one packet. * For FTS-0001 we need to create at least one packet.
*/ */

View File

@ -318,7 +318,6 @@ int main(int argc, char *argv[])
(strncasecmp(p,"EMSI_",5) == 0)) { (strncasecmp(p,"EMSI_",5) == 0)) {
master = 0; master = 0;
answermode = argv[optind]; answermode = argv[optind];
Syslog('S', "Inbound \"%s\" mode", MBSE_SS(answermode));
} else { } else {
if ((addr = parsefaddr(argv[optind]))) { if ((addr = parsefaddr(argv[optind]))) {
immediatecall = TRUE; immediatecall = TRUE;

View File

@ -1,11 +1,10 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: mbcico/recvbark.c * $Id$
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* Last modification date : 01-Jan-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -88,8 +87,6 @@ SM_START(sendenq)
SM_STATE(sendenq) SM_STATE(sendenq)
Syslog('s', "recvbark SENDINQ");
count = 0; count = 0;
PUTCHAR(ENQ); PUTCHAR(ENQ);
if (STATUS) { if (STATUS) {
@ -100,8 +97,6 @@ SM_STATE(sendenq)
SM_STATE(waitack) SM_STATE(waitack)
Syslog('s', "recvbark WAITACK");
if (count++ > 10) { if (count++ > 10) {
Syslog('+', "Wait for Bark Request: timeout"); Syslog('+', "Wait for Bark Request: timeout");
PUTCHAR(ETB); PUTCHAR(ETB);
@ -134,7 +129,6 @@ SM_STATE(waitack)
SM_STATE(waitchar) SM_STATE(waitchar)
Syslog('s', "recvbark WAITCHAR");
c=GETCHAR(15); c=GETCHAR(15);
if (c == TIMEOUT) { if (c == TIMEOUT) {
Syslog('s', "Recvbark got timeout waiting for char"); Syslog('s', "Recvbark got timeout waiting for char");
@ -157,7 +151,6 @@ SM_STATE(waitchar)
SM_STATE(scanreq) SM_STATE(scanreq)
Syslog('s', "recvbark SCANREQ");
lcrc = crc16xmodem(buf, strlen(buf)); lcrc = crc16xmodem(buf, strlen(buf));
c1 = GETCHAR(15); c1 = GETCHAR(15);
if (c1 == TIMEOUT) { if (c1 == TIMEOUT) {
@ -181,7 +174,6 @@ SM_STATE(scanreq)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('s', "recvbark SENDACK");
count = 0; count = 0;
PUTCHAR(ACK); PUTCHAR(ACK);
tosend = respond_bark(buf); tosend = respond_bark(buf);
@ -218,7 +210,6 @@ SM_STATE(waitnak)
SM_STATE(sendfiles) SM_STATE(sendfiles)
Syslog('s', "recvbark SENDFILES");
rc = xmsndfiles(tosend); rc = xmsndfiles(tosend);
tidy_filelist(tosend, 0); tidy_filelist(tosend, 0);
if (rc == 0) { if (rc == 0) {

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer - respond to filerequests * Purpose ...............: Fidonet mailer - respond to filerequests
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -66,91 +66,90 @@ static int no_more = FALSE;
file_list *respond_wazoo(void) file_list *respond_wazoo(void)
{ {
char buf[256]; char buf[256], *nm, *pw, *dt, *p;
char *nm, *pw, *dt, *p; file_list *fl=NULL, **tmpl;
file_list *fl=NULL, **tmpl; FILE *fp;
FILE *fp;
if (freqname == NULL) if (freqname == NULL)
return NULL; return NULL;
if ((fp=fopen(freqname,"r")) == NULL) { if ((fp=fopen(freqname,"r")) == NULL) {
WriteError("$cannot open received wazoo freq \"%s\"",freqname); 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);
unlink(freqname); unlink(freqname);
free(freqname); free(freqname);
freqname = NULL; freqname=NULL;
for (tmpl = &fl; *tmpl; tmpl = &((*tmpl)->next)) { return NULL;
Syslog('F', "resplist: %s",MBSE_SS((*tmpl)->local)); }
}
attach_report(&fl); tmpl=&fl;
return 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) file_list *respond_bark(char *buf)
{ {
char *nm, *pw, *dt, *p; char *nm, *pw, *dt, *p;
file_list *fl; file_list *fl;
nm = buf; nm = buf;
pw = (char *)""; pw = (char *)"";
dt = (char *)"0"; dt = (char *)"0";
while (isspace(*nm)) while (isspace(*nm))
nm++; nm++;
for (p = nm; *p && (!isspace(*p)); p++); 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) { if (*p) {
*p++ = '\0'; *p++ = '\0';
dt = p; pw = p;
while (isspace(*dt)) while (isspace(*pw))
dt++; pw++;
for (p = dt; *p && (!isspace(*p)); p++); for (p = pw; *p && (!isspace(*p)); p++);
if (*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; records = (ftell(fp) - olhdr.hdrsize) / olhdr.recsize;
srand(getpid()); srand(getpid());
recno = 1+(int) (1.0 * records * rand() / (RAND_MAX + 1.0)); 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 (fseek(fp, olhdr.hdrsize + (recno * olhdr.recsize), SEEK_SET) == 0) {
if (fread(&ol, olhdr.recsize, 1, fp) == 1) { if (fread(&ol, olhdr.recsize, 1, fp) == 1) {
add_report((char *)"\r... %s", ol.Oneline); add_report((char *)"\r... %s", ol.Oneline);

View File

@ -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"); Syslog('o' ,"scan_dir \"%s\" (%s)",MBSE_SS(dname),ispoint?"point":"node");
if ((dp = opendir(dname)) == NULL) { if ((dp = opendir(dname)) == NULL) {
Syslog('-', "Creating directory %s", dname); Syslog('+', "Creating directory %s", dname);
/* /*
* Create a fake filename, mkdirs() likes that. * Create a fake filename, mkdirs() likes that.
*/ */

View File

@ -1,11 +1,10 @@
/***************************************************************************** /*****************************************************************************
* *
* File ..................: mbcico/sendbark.c * $Id$
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* Last modification date : 29-Oct-2000
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2000 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -114,73 +113,68 @@ int sendbark(void)
SM_DECL(send_bark,(char *)"sendbark") SM_DECL(send_bark,(char *)"sendbark")
SM_STATES SM_STATES
Send, Send,
waitack, waitack,
getfile getfile
SM_NAMES SM_NAMES
(char *)"send", (char *)"send",
(char *)"waitack", (char *)"waitack",
(char *)"getfile" (char *)"getfile"
SM_EDECL SM_EDECL
int c; char buf[256];
char buf[256]; unsigned short crc;
unsigned short crc; int c, count = 0;
int count = 0;
Syslog('s', "send_bark INIT"); sprintf(buf,"%s %s %s",nm,dt,pw);
sprintf(buf,"%s %s %s",nm,dt,pw); crc = crc16xmodem(buf, strlen(buf));
crc = crc16xmodem(buf, strlen(buf)); Syslog('s', "sending bark packet \"%s\", crc = 0x%04x", buf, crc);
Syslog('s', "sending bark packet \"%s\", crc = 0x%04x", buf, crc);
SM_START(Send) SM_START(Send)
SM_STATE(Send) SM_STATE(Send)
Syslog('s', "send_bark SEND"); if (count++ > 5) {
if (count++ > 5) { Syslog('+', "Bark request failed");
Syslog('+', "Bark request failed"); SM_ERROR;
SM_ERROR; }
}
PUTCHAR(ACK); PUTCHAR(ACK);
PUT(buf, strlen(buf)); PUT(buf, strlen(buf));
PUTCHAR(ETX); PUTCHAR(ETX);
PUTCHAR(crc & 0xff); PUTCHAR(crc & 0xff);
PUTCHAR((crc >> 8) & 0xff); PUTCHAR((crc >> 8) & 0xff);
if (STATUS) { if (STATUS) {
SM_ERROR; SM_ERROR;
} else { } else {
SM_PROCEED(waitack); SM_PROCEED(waitack);
} }
SM_STATE(waitack) SM_STATE(waitack)
Syslog('s', "send_bark WAITACK"); c = GETCHAR(10);
c = GETCHAR(10); if (c == TIMEOUT) {
if (c == TIMEOUT) { Syslog('s', "sendbark got timeout waiting for ACK");
Syslog('s', "sendbark got timeout waiting for ACK"); SM_PROCEED(Send);
SM_PROCEED(Send); } else if (c < 0) {
} else if (c < 0) { SM_PROCEED(Send);
SM_PROCEED(Send); } else if (c == ACK) {
} else if (c == ACK) { SM_PROCEED(getfile);
SM_PROCEED(getfile); } else {
} else { Syslog('s', "sendbark got %s waiting for ACK", printablec(c));
Syslog('s', "sendbark got %s waiting for ACK", printablec(c)); SM_PROCEED(Send);
SM_PROCEED(Send); }
}
SM_STATE(getfile) SM_STATE(getfile)
Syslog('s', "send_bark GETFILE"); switch (xmrecv(NULL)) {
switch (xmrecv(NULL)) { case 0: SM_PROCEED(getfile);
case 0: SM_PROCEED(getfile); break;
break; case 1: SM_SUCCESS;
case 1: SM_SUCCESS; break;
break; default: SM_ERROR;
default: SM_ERROR; break;
break; }
}
SM_END SM_END
SM_RETURN SM_RETURN

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -229,7 +229,6 @@ SM_START(skipjunk)
SM_STATE(skipjunk) SM_STATE(skipjunk)
Syslog('s', "tx_define_type SKIPJUNK");
while ((c = GETCHAR(1)) >= 0) /*nothing*/ ; while ((c = GETCHAR(1)) >= 0) /*nothing*/ ;
if (c == TIMEOUT) { if (c == TIMEOUT) {
gpt_resettimers(); gpt_resettimers();
@ -241,7 +240,6 @@ SM_STATE(skipjunk)
SM_STATE(wake) SM_STATE(wake)
Syslog('s', "tx_define_type WAKE");
if (gpt_expired(0)) { if (gpt_expired(0)) {
Syslog('+', "Remote did not respond"); Syslog('+', "Remote did not respond");
SM_ERROR; SM_ERROR;
@ -256,7 +254,6 @@ SM_STATE(wake)
SM_ERROR; SM_ERROR;
} else { } else {
gpt_settimer(0, 60); gpt_settimer(0, 60);
Syslog('S', "Got %c wakeup", c);
SM_PROCEED(nextchar); SM_PROCEED(nextchar);
} }
@ -364,17 +361,13 @@ SM_STATE(checkintro)
SM_STATE(sendinq) SM_STATE(sendinq)
Syslog('s', "tx_define_type SENDINQ");
PUTCHAR(DC1); PUTCHAR(DC1);
if ((localoptions & NOEMSI) == 0) { if ((localoptions & NOEMSI) == 0) {
Syslog('S', "send **EMSI_INQC816 (2 times)");
PUTSTR((char *)"\r**EMSI_INQC816\r**EMSI_INQC816"); PUTSTR((char *)"\r**EMSI_INQC816\r**EMSI_INQC816");
} }
if ((localoptions & NOWAZOO) == 0) { if ((localoptions & NOWAZOO) == 0) {
Syslog('S', "send YOOHOO char");
PUTCHAR(YOOHOO); PUTCHAR(YOOHOO);
} }
Syslog('S', "send TSYNC char");
PUTCHAR(TSYNC); PUTCHAR(TSYNC);
if ((localoptions & NOEMSI) == 0) if ((localoptions & NOEMSI) == 0)
PUTSTR((char *)"\r\021"); PUTSTR((char *)"\r\021");

View File

@ -172,8 +172,6 @@ static int tty_read(char *buf, int size, int tot)
fd_set readfds, writefds, exceptfds; fd_set readfds, writefds, exceptfds;
struct timeval seltimer; struct timeval seltimer;
// Syslog('t', "tty_read(buf, %d, %d)", size, tot);
if (size == 0) if (size == 0)
return 0; return 0;
tty_status = 0; tty_status = 0;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -104,10 +104,8 @@ int txwazoo(void)
char *nonhold_mail; char *nonhold_mail;
Syslog('+', "Start WaZOO session"); Syslog('+', "Start WaZOO session");
// if (localoptions & NOHOLD) nonhold_mail = (char *)ALL_MAIL;
nonhold_mail = (char *)ALL_MAIL;
// else
// nonhold_mail = (char *)NONHOLD_MAIL;
if (emsi_remote_lcodes & LCODE_HAT) { if (emsi_remote_lcodes & LCODE_HAT) {
Syslog('+', "Remote asked to \"hold all traffic\", no send"); Syslog('+', "Remote asked to \"hold all traffic\", no send");
tosend = NULL; tosend = NULL;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -149,7 +149,6 @@ SM_EDECL
off_t remsize=0; off_t remsize=0;
int goteot = FALSE; int goteot = FALSE;
Syslog('x', "xmrecv INIT");
gettimeofday(&starttime, &tz); gettimeofday(&starttime, &tz);
recv_blk=-1L; recv_blk=-1L;
@ -181,7 +180,6 @@ SM_STATE(sendnak0)
SM_STATE(waitblk0) SM_STATE(waitblk0)
Syslog('x', "xmrecv WAITBLK0");
header = GETCHAR(5); header = GETCHAR(5);
if (header == TIMEOUT) { if (header == TIMEOUT) {
Syslog('x', "timeout waiting for xmodem block 0 header, count=%d", count); Syslog('x', "timeout waiting for xmodem block 0 header, count=%d", count);
@ -248,7 +246,6 @@ SM_STATE(waitblk0)
SM_STATE(sendnak) SM_STATE(sendnak)
Syslog('x', "xmrecv SENDNAK");
if (ackd_blk < 0) { if (ackd_blk < 0) {
SM_PROCEED(sendnak0); SM_PROCEED(sendnak0);
} }
@ -306,7 +303,6 @@ SM_STATE(sendack)
SM_STATE(waitblk) SM_STATE(waitblk)
Syslog('x', "xmrecv WAITBLK");
header = GETCHAR(15); header = GETCHAR(15);
if (header == TIMEOUT) { if (header == TIMEOUT) {
Syslog('x', "timeout waiting for xmodem block header, count=%d", count); Syslog('x', "timeout waiting for xmodem block header, count=%d", count);
@ -344,7 +340,6 @@ SM_STATE(waitblk)
SM_STATE(recvblk) SM_STATE(recvblk)
Syslog('x', "xmrecv RECVBLK");
Nopper(); Nopper();
GET((char*)&xmblk,(crcmode && (header != SYN))? sizeof(xmblk): sizeof(xmblk)-1,15); GET((char*)&xmblk,(crcmode && (header != SYN))? sizeof(xmblk): sizeof(xmblk)-1,15);
if (STATUS == STAT_TIMEOUT) { if (STATUS == STAT_TIMEOUT) {
@ -442,8 +437,7 @@ SM_STATE(recvblk)
SM_STATE(checktelink) 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') { if (tmpfname[0] == '\0') {
strncpy(tmpfname,xmblk.data+8,16); strncpy(tmpfname,xmblk.data+8,16);
/* /*
@ -457,7 +451,7 @@ SM_STATE(checktelink)
} }
} else { } else {
Syslog('+', "Remote uses %s",printable(xmblk.data+25,-14)); 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); 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; last_blk = (remsize-1)/XMBLKSIZ+1;
@ -518,7 +512,6 @@ SM_STATE(checktelink)
SM_STATE(recvm7) SM_STATE(recvm7)
Syslog('x', "xmrecv RECVM7");
switch (m7recv(tmpfname)) { switch (m7recv(tmpfname)) {
case 0: ackd_blk=0; case 0: ackd_blk=0;
SM_PROCEED(sendnak); SM_PROCEED(sendnak);
@ -531,7 +524,6 @@ SM_STATE(recvm7)
SM_STATE(goteof) SM_STATE(goteof)
Syslog('x', "xmrecv GOTEOF");
Slo = FALSE; Slo = FALSE;
closeit(1); closeit(1);
if (ackd_blk == -1L) if (ackd_blk == -1L)

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -124,7 +124,6 @@ SM_EDECL
fl.l_start=0L; fl.l_start=0L;
fl.l_len=0L; fl.l_len=0L;
Syslog('x', "xmsend INIT");
gettimeofday(&starttime, &tz); gettimeofday(&starttime, &tz);
/* if we got 'C' than hopefully remote is sealink capable... */ /* if we got 'C' than hopefully remote is sealink capable... */
@ -185,7 +184,6 @@ SM_START(startstate)
SM_STATE(sendm7) SM_STATE(sendm7)
Syslog('x', "xmsend SENDM7");
if (m7send(rn)) { if (m7send(rn)) {
SM_PROCEED(sendblk0); SM_PROCEED(sendblk0);
} else { } else {
@ -194,7 +192,6 @@ SM_STATE(sendm7)
SM_STATE(sendblk0) 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); 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)); 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[41]=((session_flags & FTSC_XMODEM_RES) != 0);
xmblk.data[42]=((session_flags & FTSC_XMODEM_XOF) != 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; next_blk=send_blk+1;
SM_PROCEED(sendblk); SM_PROCEED(sendblk);
SM_STATE(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) { if (send_blk == 0) {
SM_PROCEED(writeblk); 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) { if (send_blk > last_blk) {
Syslog('X', "send_blk > last_blk"); Syslog('x', "send_blk > last_blk");
if (send_blk == (last_blk+1)) { if (send_blk == (last_blk+1)) {
SM_PROCEED(sendeot); SM_PROCEED(sendeot);
} else if (ackd_blk < last_blk) { } else if (ackd_blk < last_blk) {
@ -264,7 +259,6 @@ SM_STATE(sendblk)
SM_STATE(writeblk) SM_STATE(writeblk)
Syslog('X', "xmsend WRITEBLK");
Nopper(); Nopper();
xmblk.n1=send_blk&0xff; xmblk.n1=send_blk&0xff;
xmblk.n2=~xmblk.n1; xmblk.n2=~xmblk.n1;
@ -290,7 +284,6 @@ SM_STATE(writeblk)
SM_STATE(waitack) SM_STATE(waitack)
Syslog('x', "xmsend WAITACK");
if ((count > 4) && (ackd_blk < 0)) { if ((count > 4) && (ackd_blk < 0)) {
Syslog('+', "Cannot send sealink block, try xmodem"); Syslog('+', "Cannot send sealink block, try xmodem");
window=1; window=1;
@ -309,7 +302,6 @@ SM_STATE(waitack)
} }
a = GETCHAR(20); a = GETCHAR(20);
Syslog('X', "xmsend got 0x%02x", a);
if (a == TIMEOUT) { if (a == TIMEOUT) {
if (count++ > 9) { if (count++ > 9) {
Syslog('+', "too many tries to send block"); Syslog('+', "too many tries to send block");
@ -356,7 +348,6 @@ SM_STATE(waitack)
case 1: case 1:
a1=GETCHAR(1); a1=GETCHAR(1);
a2=GETCHAR(1); a2=GETCHAR(1);
Syslog('X', "got block ACK %d", a1);
if ((a1 < 0) || (a2 < 0) || (a1 != ((~a2)&0xff))) { if ((a1 < 0) || (a2 < 0) || (a1 != ((~a2)&0xff))) {
Syslog('x', "bad ACK: 0x%02x/0x%02x, ignore", a1,a2); Syslog('x', "bad ACK: 0x%02x/0x%02x, ignore", a1,a2);
SM_PROCEED(sendblk); SM_PROCEED(sendblk);
@ -417,7 +408,6 @@ SM_STATE(waitack)
SM_STATE(resync) SM_STATE(resync)
Syslog('x', "xmsend RESYNC");
if (count++ > 9) { if (count++ > 9) {
Syslog('+', "too may tries to resync"); Syslog('+', "too may tries to resync");
SM_ERROR; SM_ERROR;
@ -464,7 +454,6 @@ SM_STATE(resync)
SM_STATE(sendeot) SM_STATE(sendeot)
Syslog('x', "xmsend SENDEOT");
PUTCHAR(EOT); PUTCHAR(EOT);
if (STATUS) { if (STATUS) {
SM_ERROR; SM_ERROR;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2003 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10

View File

@ -1,4 +1,6 @@
/* /*
* $Id$
*
* Z M . C * Z M . C
* Copyright 1994 Omen Technology Inc All Rights Reserved * Copyright 1994 Omen Technology Inc All Rights Reserved
* ZMODEM protocol primitives * ZMODEM protocol primitives
@ -712,20 +714,16 @@ int zrbhd32(register char *shdr)
Rxtype = c; Rxtype = c;
crc = 0xFFFFFFFFL; crc = updcrc32(c, crc); crc = 0xFFFFFFFFL; crc = updcrc32(c, crc);
Syslog('Z', "zrbhd32 c=%X crc=%lX", c, crc);
for (n=Rxhlen; --n >= 0; ++shdr) { for (n=Rxhlen; --n >= 0; ++shdr) {
if ((c = zdlread()) & ~0377) if ((c = zdlread()) & ~0377)
return c; return c;
crc = updcrc32(c, crc); crc = updcrc32(c, crc);
*shdr = c; *shdr = c;
Syslog('Z', "zrbhd32 c=%X crc=%lX", c, crc);
} }
for (n=4; --n >= 0;) { for (n=4; --n >= 0;) {
if ((c = zdlread()) & ~0377) if ((c = zdlread()) & ~0377)
return c; return c;
crc = updcrc32(c, crc); crc = updcrc32(c, crc);
Syslog('Z', "zrbhd32 c=%X crc=%lX", c, crc);
} }
if (crc != 0xDEBB20E3) { if (crc != 0xDEBB20E3) {
Syslog('+', "Zmodem zrbhd32: Bad CRC"); Syslog('+', "Zmodem zrbhd32: Bad CRC");
@ -791,7 +789,6 @@ void zputhex(register int c)
{ {
static char digits[] = "0123456789abcdef"; static char digits[] = "0123456789abcdef";
Syslog('Z', "zputhex: %02X", c);
BUFFER_BYTE(digits[(c&0xF0)>>4]); BUFFER_BYTE(digits[(c&0xF0)>>4]);
BUFFER_BYTE(digits[(c)&0xF]); BUFFER_BYTE(digits[(c)&0xF]);
} }
@ -847,7 +844,6 @@ int zgethex(void)
register int c; register int c;
c = zgeth1(); c = zgeth1();
Syslog('Z', "zgethex: %02X", c);
return c; return c;
} }

View File

@ -4,7 +4,7 @@
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2004
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -399,7 +399,6 @@ again:
lastcrcrq = Rxpos; lastcrcrq = Rxpos;
crc = 0xFFFFFFFFL; crc = 0xFFFFFFFFL;
fseek(in, 0L, 0); fseek(in, 0L, 0);
Syslog('Z', "bytcnt=%ld crc=%08lX", bytcnt, crc);
while (((c = getc(in)) != EOF) && --lastcrcrq) while (((c = getc(in)) != EOF) && --lastcrcrq)
crc = updcrc32(c, crc); crc = updcrc32(c, crc);
crc = ~crc; crc = ~crc;