Code cleanup and removed heavy debug messages

This commit is contained in:
Michiel Broek 2007-03-03 14:28:39 +00:00
parent be58dfe96d
commit f3e8aeeaeb
9 changed files with 10 additions and 233 deletions

View File

@ -606,10 +606,9 @@ char *printable(char *s, int l)
/*
* Don't use isprint to check if a character is printable because we
* don't want some current locale to have some influence on this
* conversion. Just filer low ascii values.
* conversion. Just filter low ascii values.
*/
c = *(unsigned char*)s;
// if (isprint(*(unsigned char*)s))
if ((c >= 32) && (c < 128))
*p++=*s;
else

View File

@ -4,7 +4,7 @@
* Purpose ...............: Files database functions
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2007
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -62,7 +62,7 @@ struct _fdbarea *mbsedb_OpenFDB(int Area, int Timeout)
return NULL;
}
msleep(250);
Syslog('f', "Open file area %d, try %d", Area, Tries);
Syslog('-', "Open file area %d, try %d", Area, Tries);
}
if (fp == NULL) {
if (errno == ENOENT) {
@ -181,7 +181,7 @@ int mbsedb_LockFDB(struct _fdbarea *fdb_area, int Timeout)
return FALSE;
}
msleep(250);
Syslog('f', "FDB lock attempt %d", Tries);
Syslog('-', "FDB lock attempt %d", Tries);
}
if (rc) {

View File

@ -4,7 +4,7 @@
* Purpose ...............: Magic filename handling
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2007
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -40,8 +40,6 @@ void magic_update(char *Alias, char *FileName)
char *path;
FILE *fp;
Syslog('f', "magic_update(%s) with %s", Alias, FileName);
if (!strlen(CFG.req_magic)) {
WriteError("No magic filename path configured");
return;

View File

@ -4,7 +4,7 @@
* Purpose ...............: Mangle a unix name to DOS 8.3 filename
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2007
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -327,7 +327,6 @@ void mangle_name_83(char *s)
/*
* First, convert some common Unix extensions to extensions of 3
* characters. If none fits, don't change anything now.
* FIXME: should be in an external file.
*/
if (strcmp(q = s + strlen(s) - strlen(".tar.gz"), ".tar.gz") == 0) {
*q = '\0';

View File

@ -255,104 +255,6 @@ void html_massage(char *inbuf, char *outbuf, size_t size)
case '&': snprintf(outptr, size, "&amp;"); break;
case '<': snprintf(outptr, size, "&lt;"); break;
case '>': snprintf(outptr, size, "&gt;"); break;
/* Not needed for UTF-8 output.
case 160: snprintf(outptr, size, "&nbsp;"); break;
case 161: snprintf(outptr, size, "&iexcl;"); break;
case 162: snprintf(outptr, size, "&cent;"); break;
case 163: snprintf(outptr, size, "&pound;"); break;
case 164: snprintf(outptr, size, "&curren;"); break;
case 165: snprintf(outptr, size, "&yen;"); break;
case 166: snprintf(outptr, size, "&brvbar;"); break;
case 167: snprintf(outptr, size, "&sect;"); break;
case 168: snprintf(outptr, size, "&uml;"); break;
case 169: snprintf(outptr, size, "&copy;"); break;
case 170: snprintf(outptr, size, "&ordf;"); break;
case 171: snprintf(outptr, size, "&laquo;"); break;
case 172: snprintf(outptr, size, "&not;"); break;
case 173: snprintf(outptr, size, "&shy;"); break;
case 174: snprintf(outptr, size, "&reg;"); break;
case 175: snprintf(outptr, size, "&macr;"); break;
case 176: snprintf(outptr, size, "&deg;"); break;
case 177: snprintf(outptr, size, "&plumin;"); break;
case 178: snprintf(outptr, size, "&sup2;"); break;
case 179: snprintf(outptr, size, "&sup3;"); break;
case 180: snprintf(outptr, size, "&acute;"); break;
case 181: snprintf(outptr, size, "&micro;"); break;
case 182: snprintf(outptr, size, "&para;"); break;
case 183: snprintf(outptr, size, "&middot;"); break;
case 184: snprintf(outptr, size, "&cedil;"); break;
case 185: snprintf(outptr, size, "&supl;"); break;
case 186: snprintf(outptr, size, "&ordm;"); break;
case 187: snprintf(outptr, size, "&raquo;"); break;
case 188: snprintf(outptr, size, "&frac14;"); break;
case 189: snprintf(outptr, size, "&frac12;"); break;
case 190: snprintf(outptr, size, "&frac34;"); break;
case 191: snprintf(outptr, size, "&iquest;"); break;
case 192: snprintf(outptr, size, "&Agrave;"); break;
case 193: snprintf(outptr, size, "&Aacute;"); break;
case 194: snprintf(outptr, size, "&Acirc;"); break;
case 195: snprintf(outptr, size, "&Atilde;"); break;
case 196: snprintf(outptr, size, "&Auml;"); break;
case 197: snprintf(outptr, size, "&Aring;"); break;
case 198: snprintf(outptr, size, "&AElig;"); break;
case 199: snprintf(outptr, size, "&Ccedil;"); break;
case 200: snprintf(outptr, size, "&Egrave;"); break;
case 201: snprintf(outptr, size, "&Eacute;"); break;
case 202: snprintf(outptr, size, "&Ecirc;"); break;
case 203: snprintf(outptr, size, "&Euml;"); break;
case 204: snprintf(outptr, size, "&Igrave;"); break;
case 205: snprintf(outptr, size, "&Iacute;"); break;
case 206: snprintf(outptr, size, "&Icirc;"); break;
case 207: snprintf(outptr, size, "&Iuml;"); break;
case 208: snprintf(outptr, size, "&ETH;"); break;
case 209: snprintf(outptr, size, "&Ntilde;"); break;
case 210: snprintf(outptr, size, "&Ograve;"); break;
case 211: snprintf(outptr, size, "&Oacute;"); break;
case 212: snprintf(outptr, size, "&Ocirc;"); break;
case 213: snprintf(outptr, size, "&Otilde;"); break;
case 214: snprintf(outptr, size, "&Ouml;"); break;
case 215: snprintf(outptr, size, "&times;"); break;
case 216: snprintf(outptr, size, "&Oslash;"); break;
case 217: snprintf(outptr, size, "&Ugrave;"); break;
case 218: snprintf(outptr, size, "&Uacute;"); break;
case 219: snprintf(outptr, size, "&Ucirc;"); break;
case 220: snprintf(outptr, size, "&Uuml;"); break;
case 221: snprintf(outptr, size, "&Yacute;"); break;
case 222: snprintf(outptr, size, "&THORN;"); break;
case 223: snprintf(outptr, size, "&szlig;"); break;
case 224: snprintf(outptr, size, "&agrave;"); break;
case 225: snprintf(outptr, size, "&aacute;"); break;
case 226: snprintf(outptr, size, "&acirc;"); break;
case 227: snprintf(outptr, size, "&atilde;"); break;
case 228: snprintf(outptr, size, "&auml;"); break;
case 229: snprintf(outptr, size, "&aring;"); break;
case 230: snprintf(outptr, size, "&aelig;"); break;
case 231: snprintf(outptr, size, "&ccedil;"); break;
case 232: snprintf(outptr, size, "&egrave;"); break;
case 233: snprintf(outptr, size, "&eacute;"); break;
case 234: snprintf(outptr, size, "&ecirc;"); break;
case 235: snprintf(outptr, size, "&euml;"); break;
case 236: snprintf(outptr, size, "&igrave;"); break;
case 237: snprintf(outptr, size, "&iacute;"); break;
case 238: snprintf(outptr, size, "&icirc;"); break;
case 239: snprintf(outptr, size, "&iuml;"); break;
case 240: snprintf(outptr, size, "&eth;"); break;
case 241: snprintf(outptr, size, "&ntilde;"); break;
case 242: snprintf(outptr, size, "&ograve;"); break;
case 243: snprintf(outptr, size, "&oacute;"); break;
case 244: snprintf(outptr, size, "&ocirc;"); break;
case 245: snprintf(outptr, size, "&otilde;"); break;
case 246: snprintf(outptr, size, "&ouml;"); break;
case 247: snprintf(outptr, size, "&divide;"); break;
case 248: snprintf(outptr, size, "&oslash;"); break;
case 249: snprintf(outptr, size, "&ugrave;"); break;
case 250: snprintf(outptr, size, "&uacute;"); break;
case 251: snprintf(outptr, size, "&ucirc;"); break;
case 252: snprintf(outptr, size, "&uuml;"); break;
case 253: snprintf(outptr, size, "&yacute;"); break;
case 254: snprintf(outptr, size, "&thorn;"); break;
case 255: snprintf(outptr, size, "&yuml;"); break;
*/
default: *outptr++ = *inptr; *outptr = '\0'; break;
}
while (*outptr)

View File

@ -4,7 +4,7 @@
* Purpose ...............: Read nodelists information
*
*****************************************************************************
* Copyright (C) 1997-2006
* Copyright (C) 1997-2007
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -344,7 +344,6 @@ void deinitnl(void)
tidy_nl_domsuf(&nl_domsuffix);
tidy_nl_service(&nl_service);
Syslog('n', "De-init nodelists done");
nlinitdone = FALSE;
}
@ -1140,13 +1139,8 @@ node *getnlent(faddr *addr)
Syslog('n', "getnlent: URL %s", printable(nodebuf.url, 0));
Syslog('n', "getnlent: online POTS %s CM %s, IP %s ICM %s", nodebuf.can_pots ?"Yes":"No",
nodebuf.is_cm ?"Yes":"No", nodebuf.can_ip ?"Yes":"No", nodebuf.is_icm ?"Yes":"No");
// moflags(nodebuf.mflags);
// diflags(nodebuf.dflags);
// ipflags(nodebuf.iflags);
// olflags(nodebuf.oflags);
// rqflags(nodebuf.xflags);
free(mydomain);
return &nodebuf;
badsyntax:
@ -1168,106 +1162,3 @@ retdummy:
}
void olflags(unsigned int flags)
{
char *t;
nodelist_flag **tmpm;
t = xstrcpy((char *)"Mailer flags :");
for (tmpm = &nl_online; *tmpm; tmpm=&((*tmpm)->next)) {
if ((*tmpm)->value & flags) {
t = xstrcat(t, (char *)" ");
t = xstrcat(t, (*tmpm)->name);
}
}
Syslog('n', "%s", t);
free(t);
}
void rqflags(unsigned int flags)
{
char *t;
nodelist_flag **tmpm;
t = xstrcpy((char *)"Request flags:");
for (tmpm = &nl_reqbits; *tmpm; tmpm=&((*tmpm)->next)) {
if ((*tmpm)->value & flags) {
t = xstrcat(t, (char *)" ");
t = xstrcat(t, (*tmpm)->name);
}
}
for (tmpm = &nl_request; *tmpm; tmpm=&((*tmpm)->next)) {
if ((*tmpm)->value == flags) {
t = xstrcat(t, (char *)" (");
t = xstrcat(t, (*tmpm)->name);
t = xstrcat(t, (char *)")");
}
}
Syslog('n', "%s", t);
free(t);
}
void moflags(unsigned int flags)
{
char *t;
nodelist_modem **tmpm;
if (!flags)
return;
t = xstrcpy((char *)"Modem flags :");
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next)) {
if ((*tmpm)->mask & flags) {
t = xstrcat(t, (char *)" ");
t = xstrcat(t, (*tmpm)->name);
}
}
Syslog('n', "%s", t);
free(t);
}
void diflags(unsigned int flags)
{
char *t;
nodelist_modem **tmpm;
if (!flags)
return;
t = xstrcpy((char *)"ISDN flags :");
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next)) {
if ((*tmpm)->mask & flags) {
t = xstrcat(t, (char *)" ");
t = xstrcat(t, (*tmpm)->name);
}
}
Syslog('n', "%s", t);
free(t);
}
void ipflags(unsigned int flags)
{
char *t;
nodelist_modem **tmpm;
if (!flags)
return;
t = xstrcpy((char *)"TCP/IP flags :");
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) {
if ((*tmpm)->mask & flags) {
t = xstrcat(t, (char *)" ");
t = xstrcat(t, (*tmpm)->name);
}
}
Syslog('n', "%s", t);
free(t);
}

View File

@ -122,11 +122,6 @@ nodelist_service *nl_service;
int initnl(void);
void deinitnl(void);
node *getnlent(faddr *);
void olflags(unsigned int);
void rqflags(unsigned int);
void moflags(unsigned int);
void diflags(unsigned int);
void ipflags(unsigned int);
#endif

View File

@ -4,7 +4,7 @@
* Purpose ...............: Regular Expression Mask
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2007
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -78,7 +78,6 @@ char *re_mask(char *nm, int forceupper)
}
*q++ = '$';
*q++ = '\0';
// Syslog('f', "Search mask \"%s\" => \"%s\"", nm, mask);
return mask;
}

View File

@ -4,7 +4,7 @@
* Purpose ...............: RFC msg
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2007
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -52,19 +52,14 @@ rfcmsg *parsrfc(FILE *fp)
while (bgets(buffer, BUFSIZ-1, fp) && strcmp(buffer,"\n")) {
newcont = (buffer[strlen(buffer)-1] != '\n');
Syslog('M', "Line read: \"%s\" - %s continued", buffer,newcont?"to be":"not to be");
if (linecont) {
Syslog('M', "this is a continuation of a long line");
cur->val=xstrcat(cur->val,buffer);
} else {
if (isspace(buffer[0])) {
if (strspn(buffer," \t\n") == strlen(buffer)) {
Syslog('M', "breaking with blank-only line");
break;
}
Syslog('M', "this is a continuation line");
if (!cur) {
Syslog('M', "Wrong first line: \"%s\"",buffer);
cur = (rfcmsg *)malloc(sizeof(rfcmsg));
start = cur;
cur->next = NULL;
@ -87,7 +82,6 @@ rfcmsg *parsrfc(FILE *fp)
cur->key = NULL;
cur->val = NULL;
if (firstline && !strncmp(buffer,"From ",5)) {
Syslog('M', "This is a uucpfrom line");
cur->key=xstrcpy((char *)"X-UUCP-From");
cur->val=xstrcpy(buffer+4);
} else if ((p=strchr(buffer,':')) && (p > buffer) && /* ':' isn't 1st chr */