Removed debug logging

This commit is contained in:
Michiel Broek 2005-08-14 12:33:06 +00:00
parent 9bdbd4ded2
commit 2cca8d0d92
2 changed files with 38 additions and 40 deletions

View File

@ -327,7 +327,7 @@ int charset_read_bin(void)
pt->next = NULL; /* overwritten by fread() */ pt->next = NULL; /* overwritten by fread() */
if (n != 1) if (n != 1)
return FALSE; return FALSE;
Syslog('s', "read charset table: %s -> %s", pt->in, pt->out); // Syslog('s', "read charset table: %s -> %s", pt->in, pt->out);
break; break;
default: return FALSE; default: return FALSE;
break; break;

View File

@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Internet Library * Purpose ...............: MBSE BBS Internet Library
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -143,19 +143,18 @@ int nntp_connect(void)
int nntp_send(char *buf) int nntp_send(char *buf)
{ {
if (nntpsock == -1) if (nntpsock == -1)
return -1; return -1;
Syslog('m', "> %s", printable(buf, 0)); if (send(nntpsock, buf, strlen(buf), 0) != strlen(buf)) {
if (send(nntpsock, buf, strlen(buf), 0) != strlen(buf)) { WriteError("$NNTP: socket send failed");
WriteError("$NNTP: socket send failed"); if (errno == ENOTCONN || errno == EPIPE) {
if (errno == ENOTCONN || errno == EPIPE) { WriteError("NNTP: closing local side");
WriteError("NNTP: closing local side"); nntpsock = -1;
nntpsock = -1;
}
return -1;
} }
return 0; return -1;
}
return 0;
} }
@ -166,38 +165,37 @@ int nntp_send(char *buf)
*/ */
char *nntp_receive(void) char *nntp_receive(void)
{ {
static char buf[SS_BUFSIZE]; static char buf[SS_BUFSIZE];
int i = 0, j; int i = 0, j;
if (nntpsock == -1) if (nntpsock == -1)
return NULL; return NULL;
memset((char *)&buf, 0, SS_BUFSIZE); memset((char *)&buf, 0, SS_BUFSIZE);
while (TRUE) { while (TRUE) {
j = recv(nntpsock, &buf[i], 1, 0); j = recv(nntpsock, &buf[i], 1, 0);
if (j == -1) { if (j == -1) {
WriteError("$NNTP: error reading socket"); WriteError("$NNTP: error reading socket");
memset((char *)&buf, 0, SS_BUFSIZE); memset((char *)&buf, 0, SS_BUFSIZE);
if (errno == ENOTCONN || errno == EPIPE) { if (errno == ENOTCONN || errno == EPIPE) {
WriteError("NNTP: closing local side"); WriteError("NNTP: closing local side");
nntpsock = -1; nntpsock = -1;
} }
return buf; return buf;
}
if (buf[i] == '\n')
break;
i += j;
} }
if (buf[i] == '\n')
break;
i += j;
}
for (i = 0; i < strlen(buf); i++) { for (i = 0; i < strlen(buf); i++) {
if (buf[i] == '\n') if (buf[i] == '\n')
buf[i] = '\0'; buf[i] = '\0';
if (buf[i] == '\r') if (buf[i] == '\r')
buf[i] = '\0'; buf[i] = '\0';
} }
Syslog('m', "< %s", printable(buf, 0)); return buf;
return buf;
} }