From 93d237073e72102640dcf3442d1887d69776921c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 28 May 1997 20:41:37 +0000 Subject: Added the interval option. svn path=/trunk/; revision=1040 --- fetchmail.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fetchmail.c') diff --git a/fetchmail.c b/fetchmail.c index 9652dab3..8438c42e 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -750,6 +750,18 @@ static int query_host(struct query *ctl) { int i, st; + if (poll_interval && ctl->server.interval) + { + if (ctl->server.poll_count++ % ctl->server.interval) + { + if (outlevel == O_VERBOSE) + fprintf(stderr, + "fetchmail: interval not reached, not querying %s\n", + ctl->server.names->id); + return PS_NOMAIL; + } + } + if (outlevel == O_VERBOSE) { time_t now; @@ -800,6 +812,9 @@ void dump_params (struct query *ctl) printf(" Logfile is %s\n", logfile); if (poll_interval) printf(" Poll interval is %d seconds\n", poll_interval); + if (ctl->server.interval) + printf(" Poll of this server will occur every %d intervals.\n", + ctl->server.interval); #ifdef HAVE_GETHOSTBYNAME if (ctl->server.canonical_name) printf(" Canonical DNS name of server is %s.\n", ctl->server.canonical_name); -- cgit v1.2.3