]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
log: Don't use 100% CPU when log connection closes.
authorTimo Sirainen <tss@iki.fi>
Wed, 7 Oct 2009 19:45:55 +0000 (15:45 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 7 Oct 2009 19:45:55 +0000 (15:45 -0400)
--HG--
branch : HEAD

src/log/log-connection.c

index b1f63a8140664ec31e755b5a413ea4316daaafe7..194721df4e7953ed35580800f3f661372f02385e 100644 (file)
@@ -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);
        }
 }