ph10 2007/01/23 14:34:02 GMT
Modified files:
exim-doc/doc-txt ChangeLog NewStuff
exim-src/src daemon.c expand.c smtp_in.c
exim-test/confs 0022
exim-test/log 0022
exim-test/stderr 0022
Log:
Add $smtp_count_at_connection_start.
Revision Changes Path
1.461 +2 -0 exim/exim-doc/doc-txt/ChangeLog
1.130 +11 -0 exim/exim-doc/doc-txt/NewStuff
1.22 +3 -1 exim/exim-src/src/daemon.c
1.77 +1 -0 exim/exim-src/src/expand.c
1.52 +4 -4 exim/exim-src/src/smtp_in.c
1.2 +2 -1 exim/exim-test/confs/0022
1.2 +2 -0 exim/exim-test/log/0022
1.4 +2 -0 exim/exim-test/stderr/0022
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.460
retrieving revision 1.461
diff -u -r1.460 -r1.461
--- ChangeLog 23 Jan 2007 12:33:08 -0000 1.460
+++ ChangeLog 23 Jan 2007 14:34:02 -0000 1.461
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.460 2007/01/23 12:33:08 magnus Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.461 2007/01/23 14:34:02 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -49,6 +49,8 @@
$auth1 could be overwritten, and so not correctly preserved, after a
successful authentication. This usually meant that the value preserved by
the server_setid option was incorrect.
+
+PH/08 Added $smtp_count_at_connection_start, deliberately with a long name.
Exim version 4.66
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -r1.129 -r1.130
--- NewStuff 22 Jan 2007 16:29:54 -0000 1.129
+++ NewStuff 23 Jan 2007 14:34:02 -0000 1.130
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.129 2007/01/22 16:29:54 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.130 2007/01/23 14:34:02 ph10 Exp $
New Features in Exim
--------------------
@@ -185,6 +185,17 @@
When ENABLE_DISABLE_FSYNC is not set, a reference to disable_fsync in a
runtime configuration generates an "unknown option" error.
+
+ 5. There is a new variable called $smtp_count_at_connection_start. The name
+ is deliberately long, in order to emphasize what the contents are. This
+ variable is set greater than zero only in processes spawned by the Exim
+ daemon for handling incoming SMTP connections. When the daemon accepts a
+ new connection, it increments this variable. A copy of the variable is
+ passed to the child process that handles the connection, but its value is
+ fixed, and never changes. It is only an approximation of how many incoming
+ connections there actually are, because many other connections may come and
+ go while a single connection is being processed. When a child process
+ terminates, the daemon decrements the variable.
Version 4.66
Index: daemon.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/daemon.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- daemon.c 17 Jan 2007 11:29:39 -0000 1.21
+++ daemon.c 23 Jan 2007 14:34:02 -0000 1.22
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/daemon.c,v 1.21 2007/01/17 11:29:39 ph10 Exp $ */
+/* $Cambridge: exim/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 @@
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 @@
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;
Index: expand.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/expand.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- expand.c 8 Jan 2007 11:56:41 -0000 1.76
+++ expand.c 23 Jan 2007 14:34:02 -0000 1.77
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/expand.c,v 1.76 2007/01/08 11:56:41 ph10 Exp $ */
+/* $Cambridge: exim/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 @@
{ "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] },
Index: smtp_in.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/smtp_in.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- smtp_in.c 18 Jan 2007 15:35:42 -0000 1.51
+++ smtp_in.c 23 Jan 2007 14:34:02 -0000 1.52
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.51 2007/01/18 15:35:42 ph10 Exp $ */
+/* $Cambridge: exim/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 @@
}
#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);
Index: 0022
===================================================================
RCS file: /home/cvs/exim/exim-test/confs/0022,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0022 7 Feb 2006 10:34:25 -0000 1.1
+++ 0022 23 Jan 2007 14:34:02 -0000 1.2
@@ -66,7 +66,8 @@
accept
freeze:
- accept control = freeze
+ accept logwrite = Connections=$smtp_count_at_connection_start
+ control = freeze
queue_only:
accept control = queue_only
Index: 0022
===================================================================
RCS file: /home/cvs/exim/exim-test/log/0022,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 0022 7 Feb 2006 10:34:46 -0000 1.1
+++ 0022 23 Jan 2007 14:34:02 -0000 1.2
@@ -1,3 +1,4 @@
+1999-03-02 09:44:33 Connections=0
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@??? U=CALLER P=local-smtp S=sss
1999-03-02 09:44:33 10HmaX-0005vi-00 frozen by ACL
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@??? U=CALLER P=local-smtp S=sss
@@ -11,6 +12,7 @@
******** SERVER ********
1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port 1225
+1999-03-02 09:44:33 Connections=1
1999-03-02 09:44:33 10HmbB-0005vi-00 <= x@y H=[127.0.0.1] P=smtp S=sss
1999-03-02 09:44:33 10HmbB-0005vi-00 frozen by ACL
1999-03-02 09:44:33 10HmbC-0005vi-00 <= x@y H=[127.0.0.1] P=smtp S=sss
Index: 0022
===================================================================
RCS file: /home/cvs/exim/exim-test/stderr/0022,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- 0022 14 Jul 2006 14:00:16 -0000 1.3
+++ 0022 23 Jan 2007 14:34:02 -0000 1.4
@@ -291,6 +291,8 @@
LOG: smtp_connection MAIN
SMTP connection from CALLER
LOG: MAIN
+ Connections=0
+LOG: MAIN
<= CALLER@??? U=CALLER P=local-smtp S=sss
LOG: MAIN
frozen by ACL