From cbc61d193386d307e35cc709591833175ed044d8 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 23 Aug 1996 16:19:00 +0000 Subject: Condition out most of the debugging. svn path=/trunk/; revision=59 --- pop3.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/pop3.c b/pop3.c index d699bd50..fa3902b9 100644 --- a/pop3.c +++ b/pop3.c @@ -193,7 +193,12 @@ struct hostrec *queryctl; ok = POP3_sendRETR(number,socket); if (ok != 0) goto cleanUp; - + +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "reading text of %d\n", number); +#endif /* DEBUGLOG */ + if (number >= first || queryctl->fetchall) ok = POP3_readmsg(socket,mboxfd, queryctl->servername, @@ -201,13 +206,29 @@ struct hostrec *queryctl; queryctl->rewrite); else ok = 0; + +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "done reading text of %d; status %d\n", number, ok); +#endif /* DEBUGLOG */ + if (ok != 0) goto cleanUp; +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "about to update last-seen field with %d\n", number); +#endif /* DEBUGLOG */ + /* update the last-seen field for this host */ if (use_uidl && (ok = POP3_sendUIDL(number, socket, &cp)) == 0) (void) strcpy(queryctl->lastid, cp); +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "about to check for deletion of %d\n", number); +#endif /* DEBUGLOG */ + /* maybe we delete this message now? */ if ((number < first && queryctl->flush) || !queryctl->keep) { if (outlevel > O_SILENT && outlevel < O_VERBOSE) @@ -221,13 +242,35 @@ struct hostrec *queryctl; else ; /* message is kept */ - /* close the mail pipe if we're using the system mailbox */ +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "about to check for mail folder close after %d\n", number); +#endif /* DEBUGLOG */ + + /* close the mail pipe, we'll reopen before next message */ if (queryctl->output == TO_MDA && (queryctl->fetchall || number >= first)) { + +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "about to close pipe\n"); +#endif /* DEBUGLOG */ + ok = closemailpipe(mboxfd); + +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "done closing pipe, status %d\n", ok); +#endif /* DEBUGLOG */ + if (ok != 0) goto cleanUp; } + +#ifdef DEBUGLOG + if (outlevel == O_VERBOSE) + fprintf(stderr, "finished processing of %d\n", number); +#endif /* DEBUGLOG */ } ok = POP3_sendQUIT(socket); -- cgit v1.2.3