From 951f5d539268a5c979aded90b2566bf40c3c51f3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 26 Apr 1999 08:04:47 +0000 Subject: Quieter UID code. svn path=/trunk/; revision=2457 --- uid.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'uid.c') diff --git a/uid.c b/uid.c index 106068e1..8cf753d0 100644 --- a/uid.c +++ b/uid.c @@ -109,23 +109,29 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile) if (outlevel >= O_DEBUG) { struct idlist *idp; + int uidlcount = 0; for (ctl = hostlist; ctl; ctl = ctl->next) + if (ctl->server.uidl) + { + report_build(stdout, "Old UID list from %s:",ctl->server.pollname); + for (idp = ctl->oldsaved; idp; idp = idp->next) + report_build(stdout, " %s", idp->id); + if (!idp) + report_build(stdout, " "); + report_complete(stdout, "\n"); + uidlcount++; + } + + if (uidlcount) { - report(stdout, "Old UID list from %s:", ctl->server.truename); - for (idp = ctl->oldsaved; idp; idp = idp->next) - report(stdout, " %s", idp->id); + report_build(stdout, "Scratch list of UIDs:"); + for (idp = scratchlist; idp; idp = idp->next) + report_build(stdout, " %s", idp->id); if (!idp) - report(stdout, ""); - report(stdout, "\n"); + report_build(stdout, " "); + report_complete(stdout, "\n"); } - - report(stdout, "Scratch list of UIDs:"); - for (idp = scratchlist; idp; idp = idp->next) - report(stdout, " %s", idp->id); - if (!idp) - report(stdout, ""); - report(stdout, "\n"); } } #endif /* POP3_ENABLE */ @@ -329,16 +335,16 @@ void update_str_lists(struct query *ctl) ctl->oldsaved = ctl->newsaved; ctl->newsaved = (struct idlist *) NULL; - if (outlevel >= O_DEBUG) + if (ctl->server.uidl && outlevel >= O_DEBUG) { struct idlist *idp; - report(stdout, "New UID list from %s:", ctl->server.truename); + report_build(stdout, "New UID list from %s:", ctl->server.pollname); for (idp = ctl->oldsaved; idp; idp = idp->next) - report(stdout, " %s = %d", idp->id, idp->val.status.mark); + report_build(stdout, " %s = %d", idp->id, idp->val.status.mark); if (!idp) - report(stdout, ""); - report(stdout, "\n"); + report_build(stdout, " "); + report_complete(stdout, "\n"); } } @@ -361,7 +367,7 @@ void write_saved_lists(struct query *hostlist, const char *idfile) if (!idcount) { if (outlevel >= O_DEBUG) - report(stdout, "Deleting fetchids file."); + report(stdout, "Deleting fetchids file.\n"); unlink(idfile); } else -- cgit v1.2.3