diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1999-04-26 07:36:37 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1999-04-26 07:36:37 +0000 |
commit | b2877c4407eec7beda1ce3d3afd3d87ee7d5d1e3 (patch) | |
tree | 99568155bbf24dff28b844e7b229f9229be19eee /uid.c | |
parent | 3039840c9e255fdfcd685574453e59fef097e895 (diff) | |
download | fetchmail-b2877c4407eec7beda1ce3d3afd3d87ee7d5d1e3.tar.gz fetchmail-b2877c4407eec7beda1ce3d3afd3d87ee7d5d1e3.tar.bz2 fetchmail-b2877c4407eec7beda1ce3d3afd3d87ee7d5d1e3.zip |
Instrument the UID code.
svn path=/trunk/; revision=2456
Diffstat (limited to 'uid.c')
-rw-r--r-- | uid.c | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -105,6 +105,28 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile) } fclose(tmpfp); } + + if (outlevel >= O_DEBUG) + { + struct idlist *idp; + + for (ctl = hostlist; ctl; ctl = ctl->next) + { + report(stdout, "Old UID list from %s:", ctl->server.truename); + for (idp = ctl->oldsaved; idp; idp = idp->next) + report(stdout, " %s", idp->id); + if (!idp) + report(stdout, "<empty>"); + report(stdout, "\n"); + } + + report(stdout, "Scratch list of UIDs:"); + for (idp = scratchlist; idp; idp = idp->next) + report(stdout, " %s", idp->id); + if (!idp) + report(stdout, "<empty>"); + report(stdout, "\n"); + } } #endif /* POP3_ENABLE */ @@ -306,6 +328,18 @@ void update_str_lists(struct query *ctl) free_str_list(&ctl->oldsaved); ctl->oldsaved = ctl->newsaved; ctl->newsaved = (struct idlist *) NULL; + + if (outlevel >= O_DEBUG) + { + struct idlist *idp; + + report(stdout, "New UID list from %s:", ctl->server.truename); + for (idp = ctl->oldsaved; idp; idp = idp->next) + report(stdout, " %s = %d", idp->id, idp->val.status.mark); + if (!idp) + report(stdout, "<empty>"); + report(stdout, "\n"); + } } void write_saved_lists(struct query *hostlist, const char *idfile) @@ -325,7 +359,11 @@ void write_saved_lists(struct query *hostlist, const char *idfile) /* either nuke the file or write updated last-seen IDs */ if (!idcount) + { + if (outlevel >= O_DEBUG) + report(stdout, "Deleting fetchids file."); unlink(idfile); + } else if ((tmpfp = fopen(idfile, "w")) != (FILE *)NULL) { for (ctl = hostlist; ctl; ctl = ctl->next) { |