Only log responses

This commit is contained in:
Michiel Broek 2007-10-14 15:19:16 +00:00
parent 4f028c4ff1
commit e43bfba131
2 changed files with 12 additions and 3 deletions

View File

@ -65,7 +65,7 @@ void send_xlat(char *inp)
strncpy(temp, chartran(inp), sizeof(temp) -1); strncpy(temp, chartran(inp), sizeof(temp) -1);
Syslog('n', "> \"%s\"", printable(temp, 0)); // Syslog('n', "> \"%s\"", printable(temp, 0));
PUTSTR(temp); PUTSTR(temp);
PUTSTR((char *)"\r\n"); PUTSTR((char *)"\r\n");

View File

@ -272,7 +272,7 @@ int get_nntp(char *buf, int max)
void send_nntp(const char *format, ...) void send_nntp(const char *format, ...)
{ {
char *out; char *out, p[4];
va_list va_ptr; va_list va_ptr;
out = calloc(4096, sizeof(char)); out = calloc(4096, sizeof(char));
@ -281,7 +281,16 @@ void send_nntp(const char *format, ...)
vsnprintf(out, 4096, format, va_ptr); vsnprintf(out, 4096, format, va_ptr);
va_end(va_ptr); va_end(va_ptr);
Syslog('n', "> \"%s\"", printable(out, 0)); /*
* Only log responses
*/
if (out[4] == ' ') {
strncpy(p, out, 3);
if (atoi(p) > 0) {
Syslog('n', "> \"%s\"", printable(out, 0));
}
}
PUTSTR(out); PUTSTR(out);
PUTSTR((char *)"\r\n"); PUTSTR((char *)"\r\n");
FLUSHOUT(); FLUSHOUT();