summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2007-01-23 14:34:02 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2007-01-23 14:34:02 +0000
commitb01dd148c3a5f3a70817b08e41ad21aeee1d8f28 (patch)
treee9dfc1bd554489b8c4444d7d806f12a28985f79d /src
parent0e8a94711a90ed63933a10ac7598e8743432837c (diff)
Add $smtp_count_at_connection_start.
Diffstat (limited to 'src')
-rw-r--r--src/src/daemon.c6
-rw-r--r--src/src/expand.c3
-rw-r--r--src/src/smtp_in.c10
3 files changed, 11 insertions, 8 deletions
diff --git a/src/src/daemon.c b/src/src/daemon.c
index 1e639453c..4c6c90878 100644
--- a/src/src/daemon.c
+++ b/src/src/daemon.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/daemon.c,v 1.21 2007/01/17 11:29:39 ph10 Exp $ */
+/* $Cambridge: exim/src/src/daemon.c,v 1.22 2007/01/23 14:34:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -369,6 +369,8 @@ if (pid == 0)
struct sigaction act;
#endif
+ smtp_accept_count++; /* So that it includes this process */
+
/* May have been modified for the subprocess */
log_write_selector = use_log_write_selector;
@@ -459,7 +461,7 @@ if (pid == 0)
configured value and may therefore already be TRUE. Leave logging
till later so it will have a message id attached. */
- if (smtp_accept_queue > 0 && smtp_accept_count >= smtp_accept_queue)
+ if (smtp_accept_queue > 0 && smtp_accept_count > smtp_accept_queue)
{
local_queue_only = TRUE;
queue_only_reason = 1;
diff --git a/src/src/expand.c b/src/src/expand.c
index c7a4749d9..03cc85a80 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/expand.c,v 1.76 2007/01/08 11:56:41 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.77 2007/01/23 14:34:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -528,6 +528,7 @@ static var_entry var_table[] = {
{ "smtp_active_hostname", vtype_stringptr, &smtp_active_hostname },
{ "smtp_command", vtype_stringptr, &smtp_cmd_buffer },
{ "smtp_command_argument", vtype_stringptr, &smtp_cmd_argument },
+ { "smtp_count_at_connection_start", vtype_int, &smtp_accept_count },
{ "sn0", vtype_filter_int, &filter_sn[0] },
{ "sn1", vtype_filter_int, &filter_sn[1] },
{ "sn2", vtype_filter_int, &filter_sn[2] },
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index ea7039935..b6a6669e9 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/smtp_in.c,v 1.51 2007/01/18 15:35:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/smtp_in.c,v 1.52 2007/01/23 14:34:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1594,18 +1594,18 @@ if (!sender_host_unknown)
}
#endif
- /* Check for reserved slots. Note that the count value doesn't include
- this process, as it gets upped in the parent process. */
+ /* Check for reserved slots. The value of smtp_accept_count has already been
+ incremented to include this process. */
if (smtp_accept_max > 0 &&
- smtp_accept_count + 1 > smtp_accept_max - smtp_accept_reserve)
+ smtp_accept_count > smtp_accept_max - smtp_accept_reserve)
{
if ((rc = verify_check_host(&smtp_reserve_hosts)) != OK)
{
log_write(L_connection_reject,
LOG_MAIN, "temporarily refused connection from %s: not in "
"reserve list: connected=%d max=%d reserve=%d%s",
- host_and_ident(FALSE), smtp_accept_count, smtp_accept_max,
+ host_and_ident(FALSE), smtp_accept_count - 1, smtp_accept_max,
smtp_accept_reserve, (rc == DEFER)? " (lookup deferred)" : "");
smtp_printf("421 %s: Too many concurrent SMTP connections; "
"please try again later\r\n", smtp_active_hostname);