diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-10-17 14:12:11 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-10-17 14:12:11 +0000 |
commit | 001ba3be1d72c8d881fc38c1f57286c0a384e8ed (patch) | |
tree | b37fa780535ba61047086ec89c3ea733c1e3368e /driver.c | |
parent | 6b66271ad9aa247eca44c9f1919bf4d04672e6d3 (diff) | |
download | fetchmail-001ba3be1d72c8d881fc38c1f57286c0a384e8ed.tar.gz fetchmail-001ba3be1d72c8d881fc38c1f57286c0a384e8ed.tar.bz2 fetchmail-001ba3be1d72c8d881fc38c1f57286c0a384e8ed.zip |
Only re-poll when we've had actual dispatches.
svn path=/trunk/; revision=1521
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1467,7 +1467,7 @@ const struct method *proto; /* protocol method table */ { char buf [POPBUFSIZE+1], *realhost; int *msgsizes, len, num, count, new, deletions = 0; - int port, fetches; + int port, fetches, dispatches; struct idlist *idp; /* execute pre-initialization command, if any */ @@ -1555,6 +1555,7 @@ const struct method *proto; /* protocol method table */ for (idp = ctl->mailboxes; idp; idp = idp->next) { do { + dispatches = 0; ++pass; if (outlevel >= O_VERBOSE) @@ -1797,6 +1798,10 @@ const struct method *proto; /* protocol method table */ } } + /* count # messages forwarded on this pass */ + if (!suppress_forward) + dispatches++; + /* * Check to see if the numbers matched? * @@ -1898,15 +1903,20 @@ const struct method *proto; /* protocol method table */ } } while /* - * Only re-poll if we allowed deletions and had no errors. + * Only re-poll if we had some actual forwards, allowed + * deletions and had no errors. * Otherwise it is far too easy to get into infinite loops. */ - (fetches && protocol->retry && !ctl->keep && !ctl->errcount); + (dispatches && protocol->retry && !ctl->keep && !ctl->errcount); } no_error: set_timeout(ctl->server.timeout); ok = (protocol->logout_cmd)(sock, ctl); + /* + * Hmmmm...arguably this would be incorrect if we had fetches but + * no dispatches (due to oversized messages, etc.) + */ if (ok == 0) ok = (fetches > 0) ? PS_SUCCESS : PS_NOMAIL; set_timeout(0); |