aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-11-08 08:40:11 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-11-08 08:40:11 +0000
commit78be978edfd5a5346ab773f1e3eb2240d29688b4 (patch)
treecc64afc47af2f3af50b8cdc72cd46ef2d0b6d767 /driver.c
parent40350ef54e836c2d263b9835a9f72ef6d972628d (diff)
downloadfetchmail-78be978edfd5a5346ab773f1e3eb2240d29688b4.tar.gz
fetchmail-78be978edfd5a5346ab773f1e3eb2240d29688b4.tar.bz2
fetchmail-78be978edfd5a5346ab773f1e3eb2240d29688b4.zip
Part of the batchlimit diff got mislaid.
svn path=/trunk/; revision=506
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/driver.c b/driver.c
index 37ea638a..15a202f8 100644
--- a/driver.c
+++ b/driver.c
@@ -42,6 +42,8 @@
#define SMTP_PORT 25 /* standard SMTP service port */
+int batchlimit; /* how often to tear down the delivery connection */
+
static const struct method *protocol;
static jmp_buf restart;
@@ -203,8 +205,18 @@ static FILE *smtp_open(ctl)
/* try to open a socket to the appropriate SMTP server for this query */
struct query *ctl;
{
+ static int batchcount;
+
ctl = ctl->leader; /* go to the SMTP leader for this query */
+ /* maybe it's time to close the socket in order to force delivery */
+ if (batchlimit && ctl->smtp_sockfp && batchcount++ == batchlimit)
+ {
+ fclose(ctl->smtp_sockfp);
+ ctl->smtp_sockfp = (FILE *)NULL;
+ batchcount = 0;
+ }
+
/* if no socket to this host is already set up, try to open one */
if (ctl->smtp_sockfp == (FILE *)NULL)
{