From: Timo Sirainen Date: Wed, 7 Oct 2009 19:45:55 +0000 (-0400) Subject: log: Don't use 100% CPU when log connection closes. X-Git-Tag: 2.0.alpha1~71 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7feff164fa1a09aefcd6e41b8dcdf6d921440d26;p=thirdparty%2Fdovecot%2Fcore.git log: Don't use 100% CPU when log connection closes. --HG-- branch : HEAD --- diff --git a/src/log/log-connection.c b/src/log/log-connection.c index b1f63a8140..194721df4e 100644 --- a/src/log/log-connection.c +++ b/src/log/log-connection.c @@ -217,9 +217,13 @@ static void log_connection_input(struct log_connection *log) while ((line = i_stream_read_next_line(log->input)) != NULL) log_it(log, line); - if (log->input->stream_errno != 0) { + if (log->input->eof) + log_connection_destroy(log); + else if (log->input->stream_errno != 0) { i_error("read(log pipe) failed: %m"); log_connection_destroy(log); + } else { + i_assert(!log->input->closed); } }