dovecot-2.2: log: Don't confuse process sending a partial log li...

dovecot at dovecot.org dovecot at dovecot.org
Sat Apr 25 09:09:23 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/211099aefe77
changeset: 18485:211099aefe77
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Apr 25 12:07:44 2015 +0300
description:
log: Don't confuse process sending a partial log line to process sending logs too fast.
If it's a partial line we don't want to show the "service too fast" error in
ps title.

diffstat:

 src/log/log-connection.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 1b3224f0135f -r 211099aefe77 src/log/log-connection.c
--- a/src/log/log-connection.c	Sat Apr 25 11:52:02 2015 +0300
+++ b/src/log/log-connection.c	Sat Apr 25 12:07:44 2015 +0300
@@ -326,6 +326,7 @@
 	ssize_t ret;
 	struct timeval now, start_timeval;
 	struct tm tm;
+	bool too_much = FALSE;
 
 	if (!log->handshaked) {
 		if (log_connection_handshake(log) < 0) {
@@ -344,8 +345,10 @@
 		while ((line = i_stream_next_line(log->input)) != NULL)
 			log_it(log, line, &now, &tm);
 		io_loop_time_refresh();
-		if (timeval_diff_msecs(&ioloop_timeval, &start_timeval) > MAX_MSECS_PER_CONNECTION)
+		if (timeval_diff_msecs(&ioloop_timeval, &start_timeval) > MAX_MSECS_PER_CONNECTION) {
+			too_much = TRUE;
 			break;
+		}
 	}
 
 	if (log->input->eof)
@@ -355,7 +358,7 @@
 		log_connection_destroy(log);
 	} else {
 		i_assert(!log->input->closed);
-		if (ret == 0) {
+		if (!too_much) {
 			if (log->pending_count > 0) {
 				log->pending_count = 0;
 				i_assert(global_pending_count > 0);


More information about the dovecot-cvs mailing list