From: Timo Sirainen Date: Sat, 25 Apr 2015 09:07:44 +0000 (+0300) Subject: log: Don't confuse process sending a partial log line to process sending logs too... X-Git-Tag: 2.2.17.rc1~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffafd76c96f018523f23601bc57200ec013c84a4;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/log/log-connection.c b/src/log/log-connection.c index a8a02d2fe5..2abf4904f3 100644 --- a/src/log/log-connection.c +++ b/src/log/log-connection.c @@ -326,6 +326,7 @@ static void log_connection_input(struct log_connection *log) 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 @@ static void log_connection_input(struct log_connection *log) 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 @@ static void log_connection_input(struct log_connection *log) 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);