Clean up the debugging output

This commit is contained in:
Dag-Erling Smørgrav 2000-07-11 18:07:09 +00:00
parent a95d6fda80
commit ec894321e3
2 changed files with 3 additions and 12 deletions

View File

@ -173,9 +173,7 @@ _fetch_connect(char *host, int port, int af, int verbose)
struct addrinfo hints, *res, *res0; struct addrinfo hints, *res, *res0;
int sd, err; int sd, err;
#ifndef NDEBUG DEBUG(fprintf(stderr, "\033[1m---> %s:%d\033[m\n", host, port));
fprintf(stderr, "\033[1m---> %s:%d\033[m\n", host, port);
#endif
if (verbose) if (verbose)
_fetch_info("looking up %s", host); _fetch_info("looking up %s", host);
@ -292,6 +290,7 @@ _fetch_getln(int fd, char **buf, size_t *size, size_t *len)
} }
} while (c != '\n'); } while (c != '\n');
DEBUG(fprintf(stderr, "\033[1m<<< %.*s\033[m", (int)*len, *buf));
return 0; return 0;
} }

View File

@ -138,18 +138,12 @@ _ftp_chkerr(int cd)
_fetch_syserr(); _fetch_syserr();
return -1; return -1;
} }
#ifndef NDEBUG
_fetch_info("got reply '%.*s'", lr_length - 2, last_reply);
#endif
if (isftpinfo(last_reply)) { if (isftpinfo(last_reply)) {
while (!isftpreply(last_reply)) { while (!isftpreply(last_reply)) {
if (_fetch_getln(cd, &last_reply, &lr_size, &lr_length) == -1) { if (_fetch_getln(cd, &last_reply, &lr_size, &lr_length) == -1) {
_fetch_syserr(); _fetch_syserr();
return -1; return -1;
} }
#ifndef NDEBUG
_fetch_info("got reply '%.*s'", lr_length - 2, last_reply);
#endif
} }
} }
@ -189,9 +183,7 @@ _ftp_cmd(int cd, char *fmt, ...)
_fetch_syserr(); _fetch_syserr();
return -1; return -1;
} }
#ifndef NDEBUG DEBUG(fprintf(stderr, "\033[1m>>> %s\n\033[m", msg));
_fetch_info("sending '%s'", msg);
#endif
iov[0].iov_base = msg; iov[0].iov_base = msg;
iov[0].iov_len = strlen(msg); iov[0].iov_len = strlen(msg);
iov[1].iov_base = ENDL; iov[1].iov_base = ENDL;