From: Jeremy Harris Date: Sun, 20 Aug 2017 12:42:16 +0000 (+0100) Subject: Logging: add elapsed-time element to unexpected-diconnection lines X-Git-Tag: exim-4_90_RC1~86 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/2ac258501be0bcb0628548d5990de76ce7361ac8 Logging: add elapsed-time element to unexpected-diconnection lines --- diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 9721fb7d6..d6250d12d 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -5460,14 +5460,17 @@ while (done <= 0) */ if (sender_address != NULL || recipients_count > 0) - log_write(L_lost_incoming_connection, - LOG_MAIN, - "unexpected %s while reading SMTP command from %s%s", - sender_host_unknown? "EOF" : "disconnection", - host_and_ident(FALSE), smtp_read_error); - - else log_write(L_smtp_connection, LOG_MAIN, "%s lost%s", - smtp_get_connection_info(), smtp_read_error); + log_write(L_lost_incoming_connection, LOG_MAIN, + "unexpected %s while reading SMTP command from %s%s D=%s", + sender_host_unknown ? "EOF" : "disconnection", + host_and_ident(FALSE), smtp_read_error, + string_timesince(&smtp_connection_start) + ); + + else + log_write(L_smtp_connection, LOG_MAIN, "%s lost%s D=%s", + smtp_get_connection_info(), smtp_read_error, + string_timesince(&smtp_connection_start)); done = 1; break; diff --git a/test/log/0609 b/test/log/0609 index a19051aa1..b395954a4 100644 --- a/test/log/0609 +++ b/test/log/0609 @@ -4,4 +4,4 @@ 1999-03-02 09:44:33 SMTP connection from [127.0.0.1] (TCP/IP connection count = 1) 1999-03-02 09:44:33 SMTP connection from [127.0.0.1] closed by QUIT 1999-03-02 09:44:33 SMTP connection from [127.0.0.1] (TCP/IP connection count = 1) -1999-03-02 09:44:33 unexpected disconnection while reading SMTP command from [127.0.0.1] +1999-03-02 09:44:33 unexpected disconnection while reading SMTP command from [127.0.0.1] D=qqs diff --git a/test/stderr/0004 b/test/stderr/0004 index 310a4ef29..b9e93a910 100644 --- a/test/stderr/0004 +++ b/test/stderr/0004 @@ -479,4 +479,4 @@ LOG: H=[1.1.1.1] F= rejected RCPT >>> deny: condition test succeeded in ACL "check_recipient" >>> end of ACL "check_recipient": DENY LOG: H=[1.1.1.1] F= rejected RCPT -LOG: unexpected disconnection while reading SMTP command from [1.1.1.1] +LOG: unexpected disconnection while reading SMTP command from [1.1.1.1] D=qqs diff --git a/test/stderr/0609 b/test/stderr/0609 index be6514446..ea998d6d7 100644 --- a/test/stderr/0609 +++ b/test/stderr/0609 @@ -45,7 +45,7 @@ ppppp delay cancelled by peer close ppppp accept: condition test succeeded in ACL "delay4_accept" ppppp end of ACL "delay4_accept": ACCEPT ppppp LOG: lost_incoming_connection MAIN -ppppp unexpected disconnection while reading SMTP command from [127.0.0.1] +ppppp unexpected disconnection while reading SMTP command from [127.0.0.1] D=qqs ppppp child ppppp ended: status=0x100 ppppp normal exit, 1 ppppp 0 SMTP accept processes now running diff --git a/test/stderr/5840 b/test/stderr/5840 index bc8aeca30..51962ce66 100644 --- a/test/stderr/5840 +++ b/test/stderr/5840 @@ -65,7 +65,7 @@ >>> ----------- end verify ------------ >>> accept: condition test succeeded in inline ACL >>> end of inline ACL: ACCEPT -LOG: unexpected disconnection while reading SMTP command from [127.0.0.1] +LOG: unexpected disconnection while reading SMTP command from [127.0.0.1] D=qqs ### TLSA (2 0 1) ### A server with a nonverifying cert and no TLSA ### A server with a verifying cert and no TLSA