aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-04-29 03:35:16 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-04-29 03:35:16 +0000
commit6e926d7be7901b1b9c6456a135728b9a929186df (patch)
tree812dadf417ec9edad298d0bbda926785ba97b064 /driver.c
parent951f5d539268a5c979aded90b2566bf40c3c51f3 (diff)
downloadfetchmail-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.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/driver.c b/driver.c
index 1172ca30..403bde10 100644
--- a/driver.c
+++ b/driver.c
@@ -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);
}