From 7feff164fa1a09aefcd6e41b8dcdf6d921440d26 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 7 Oct 2009 15:45:55 -0400 Subject: [PATCH] log: Don't use 100% CPU when log connection closes. --HG-- branch : HEAD --- src/log/log-connection.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } } -- 2.47.3