diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2017-08-20 13:42:16 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2017-08-20 13:42:16 +0100 |
commit | 2ac258501be0bcb0628548d5990de76ce7361ac8 (patch) | |
tree | d52755f08a7579dab8ba4eb0c418d52c009812ca | |
parent | cb6832770fe8ae9b3d2a27e5f2f622eb06873587 (diff) |
Logging: add elapsed-time element to unexpected-diconnection lines
-rw-r--r-- | src/src/smtp_in.c | 19 | ||||
-rw-r--r-- | test/log/0609 | 2 | ||||
-rw-r--r-- | test/stderr/0004 | 2 | ||||
-rw-r--r-- | test/stderr/0609 | 2 | ||||
-rw-r--r-- | test/stderr/5840 | 2 |
5 files changed, 15 insertions, 12 deletions
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=<BY@aa.bb> rejected RCPT <x@test.ex> >>> deny: condition test succeeded in ACL "check_recipient" >>> end of ACL "check_recipient": DENY LOG: H=[1.1.1.1] F=<BlOcKeD@zz.xy> rejected RCPT <x@test.ex> -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 |