* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20010720"
+#define DEF_MAIL_VERSION "Snapshot-20010721"
extern char *var_mail_version;
/* LICENSE
msg_panic("%s: bad length %d", myname, len);
/*
- * Read and discard N bytes.
+ * Write or discard N bytes.
*/
for (count = len; count > 0; count -= n)
- if ((n = read(MASTER_FLOW_READ, buf, count > BUFFER_SIZE ?
+ if ((n = write(MASTER_FLOW_WRITE, buf, count > BUFFER_SIZE ?
BUFFER_SIZE : count)) < 0)
return (-1);
if (msg_verbose)
bool var_allow_min_user;
int var_local_con_lim;
int var_local_rcpt_lim;
+int var_proc_limit;
static QMGR_SCAN *qmgr_incoming;
static QMGR_SCAN *qmgr_deferred;
{
char *in_path = 0;
char *df_path = 0;
+int token_count;
/*
* This routine runs as part of the event handling loop, after the event
* get ahead of the queue manager, but don't block them completely.
*/
if (var_glob_flow_ctl) {
- if (in_path)
- mail_flow_put(1);
- else
- mail_flow_get(1000);
+ if (in_path != 0)
+ mail_flow_put(1);
+ else if ((token_count = peekfd(MASTER_FLOW_READ)) < var_proc_limit)
+ mail_flow_put(var_proc_limit - token_count);
+ else if (token_count > var_proc_limit)
+ mail_flow_get(token_count - var_proc_limit);
}
if (in_path || df_path)
return (DONT_WAIT);
VAR_DEST_RCPT_LIMIT, DEF_DEST_RCPT_LIMIT, &var_dest_rcpt_limit, 0, 0,
VAR_LOCAL_RCPT_LIMIT, DEF_LOCAL_RCPT_LIMIT, &var_local_rcpt_lim, 0, 0,
VAR_LOCAL_CON_LIMIT, DEF_LOCAL_CON_LIMIT, &var_local_con_lim, 0, 0,
+ VAR_PROC_LIMIT, DEF_PROC_LIMIT, &var_proc_limit, 1, 0,
0,
};
static CONFIG_BOOL_TABLE bool_table[] = {
int var_qmgr_hog;
int var_local_rcpt_lim; /* XXX */
int var_local_con_lim; /* XXX */
+int var_proc_limit;
static QMGR_SCAN *qmgr_incoming;
static QMGR_SCAN *qmgr_deferred;
{
char *in_path = 0;
char *df_path = 0;
+ int token_count;
/*
* This routine runs as part of the event handling loop, after the event
* get ahead of the queue manager, but don't block them completely.
*/
if (var_glob_flow_ctl) {
- if (in_path)
+ if (in_path != 0)
mail_flow_put(1);
- else
- mail_flow_get(1000);
+ else if ((token_count = peekfd(MASTER_FLOW_READ)) < var_proc_limit)
+ mail_flow_put(var_proc_limit - token_count);
+ else if (token_count > var_proc_limit)
+ mail_flow_get(token_count - var_proc_limit);
}
if (in_path || df_path)
return (DONT_WAIT);
VAR_QMGR_HOG, DEF_QMGR_HOG, &var_qmgr_hog, 10, 100,
VAR_LOCAL_RCPT_LIMIT, DEF_LOCAL_RCPT_LIMIT, &var_local_rcpt_lim, 0, 0,
VAR_LOCAL_CON_LIMIT, DEF_LOCAL_CON_LIMIT, &var_local_con_lim, 0, 0,
+ VAR_PROC_LIMIT, DEF_PROC_LIMIT, &var_proc_limit, 1, 0,
0,
};
static CONFIG_BOOL_TABLE bool_table[] = {