From 4adc40ad053d031ad44183c7d733a0ff2809713d Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Sat, 27 May 1995 16:36:38 -0800 Subject: [PATCH] make the maximum number of jobs in one queue run an option SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.174 SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.135 SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.94 SCCS-vsn: usr.sbin/sendmail/src/queue.c 8.83 --- usr/src/usr.sbin/sendmail/src/conf.h | 6 +----- usr/src/usr.sbin/sendmail/src/queue.c | 6 +++--- usr/src/usr.sbin/sendmail/src/readcf.c | 8 +++++++- usr/src/usr.sbin/sendmail/src/sendmail.h | 5 +++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/conf.h b/usr/src/usr.sbin/sendmail/src/conf.h index 5976e5b99d..246f8129d9 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.h +++ b/usr/src/usr.sbin/sendmail/src/conf.h @@ -5,7 +5,7 @@ * * %sccs.include.redist.c% * - * @(#)conf.h 8.173 (Berkeley) %G% + * @(#)conf.h 8.174 (Berkeley) %G% */ /* @@ -51,10 +51,6 @@ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ # define MAXMIMENESTING 20 /* max MIME multipart nesting */ # define QUEUESEGSIZE 1000 /* increment for queue size */ -# ifndef MAXQUEUESIZE -# define MAXQUEUESIZE 40000 /* max # of jobs we will run at once */ -# endif - /********************************************************************** ** Compilation options. ** diff --git a/usr/src/usr.sbin/sendmail/src/queue.c b/usr/src/usr.sbin/sendmail/src/queue.c index af396da832..baea5486e4 100644 --- a/usr/src/usr.sbin/sendmail/src/queue.c +++ b/usr/src/usr.sbin/sendmail/src/queue.c @@ -10,9 +10,9 @@ #ifndef lint #ifdef QUEUE -static char sccsid[] = "@(#)queue.c 8.82 (Berkeley) %G% (with queueing)"; +static char sccsid[] = "@(#)queue.c 8.83 (Berkeley) %G% (with queueing)"; #else -static char sccsid[] = "@(#)queue.c 8.82 (Berkeley) %G% (without queueing)"; +static char sccsid[] = "@(#)queue.c 8.83 (Berkeley) %G% (without queueing)"; #endif #endif /* not lint */ @@ -915,7 +915,7 @@ grow_wlist() { if (tTd(41, 1)) printf("grow_wlist: WorkListSize=%d\n", WorkListSize); - if (WorkListSize >= MAXQUEUESIZE) + if (MaxQueueRun > 0 && WorkListSize >= MaxQueueRun) { # ifdef LOG if (LogLevel > 0) diff --git a/usr/src/usr.sbin/sendmail/src/readcf.c b/usr/src/usr.sbin/sendmail/src/readcf.c index 84b2aa5494..8cc80e1da5 100644 --- a/usr/src/usr.sbin/sendmail/src/readcf.c +++ b/usr/src/usr.sbin/sendmail/src/readcf.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)readcf.c 8.93 (Berkeley) %G%"; +static char sccsid[] = "@(#)readcf.c 8.94 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -1364,6 +1364,8 @@ struct optioninfo "MaxMessageSize", O_MAXMSGSIZE, FALSE, #define O_COLONOKINADDR 0x8b "ColonOkInAddr", O_COLONOKINADDR, TRUE, +#define O_MAXQUEUERUN 0x8c + "MaxQueueRunSize", O_MAXQUEUERUN, TRUE, NULL, '\0', FALSE, }; @@ -1994,6 +1996,10 @@ setoption(opt, val, sticky) ColonOkInAddr = atobool(p); break; + case O_MAXQUEUERUN: /* max # of jobs in a single queue run */ + MaxQueueRun = atol(p); + break; + default: if (tTd(37, 1)) { diff --git a/usr/src/usr.sbin/sendmail/src/sendmail.h b/usr/src/usr.sbin/sendmail/src/sendmail.h index a8ce807543..ae0cd25739 100644 --- a/usr/src/usr.sbin/sendmail/src/sendmail.h +++ b/usr/src/usr.sbin/sendmail/src/sendmail.h @@ -5,7 +5,7 @@ * * %sccs.include.redist.c% * - * @(#)sendmail.h 8.134 (Berkeley) %G% + * @(#)sendmail.h 8.135 (Berkeley) %G% */ /* @@ -15,7 +15,7 @@ # ifdef _DEFINE # define EXTERN # ifndef lint -static char SmailSccsId[] = "@(#)sendmail.h 8.134 %G%"; +static char SmailSccsId[] = "@(#)sendmail.h 8.135 %G%"; # endif # else /* _DEFINE */ # define EXTERN extern @@ -985,6 +985,7 @@ EXTERN time_t MinQueueAge; /* min delivery interval */ EXTERN time_t DialDelay; /* delay between dial-on-demand tries */ EXTERN char *SafeFileEnv; /* chroot location for file delivery */ EXTERN char *HostsFile; /* path to /etc/hosts file */ +EXTERN int MaxQueueRun; /* maximum number of jobs in one queue run */ EXTERN char *ServiceSwitchFile; /* backup service switch */ EXTERN char *DefaultCharSet; /* default character set for MIME */ EXTERN int DeliveryNiceness; /* how nice to be during delivery */ -- 2.20.1