diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1999-04-29 03:35:16 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1999-04-29 03:35:16 +0000 |
commit | 6e926d7be7901b1b9c6456a135728b9a929186df (patch) | |
tree | 812dadf417ec9edad298d0bbda926785ba97b064 /driver.c | |
parent | 951f5d539268a5c979aded90b2566bf40c3c51f3 (diff) | |
download | fetchmail-6e926d7be7901b1b9c6456a135728b9a929186df.tar.gz fetchmail-6e926d7be7901b1b9c6456a135728b9a929186df.tar.bz2 fetchmail-6e926d7be7901b1b9c6456a135728b9a929186df.zip |
Cleaner retry logic.
svn path=/trunk/; revision=2458
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -2197,15 +2197,20 @@ const struct method *proto; /* protocol method table */ break; if (ok != PS_LOCKBUSY) lockouts = 0; - - /* - * Allow time for the server lock to release. if we don't - * do this, we'll often hit a locked-mailbox condition and fail. - */ - sleep(3); + else if (lockouts >= MAX_LOCKOUTS) + break; + else /* ok == PS_LOCKBUSY */ + { + /* + * Allow time for the server lock to release. if we + * don't do this, we'll often hit a locked-mailbox + * condition and fail. + */ + lockouts++; + sleep(3); + } } while - (ok == PS_MAXFETCH - || (ok == PS_LOCKBUSY && lockouts++ < MAX_LOCKOUTS)); + (ok == PS_MAXFETCH || ok == PS_LOCKBUSY); return(ok); } |