dovecot-2.0: log: Don't use 100% CPU when log connection closes.
dovecot at dovecot.org
dovecot at dovecot.org
Wed Oct 7 22:46:01 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/1aff70cee4d9
changeset: 9981:1aff70cee4d9
user: Timo Sirainen <tss at iki.fi>
date: Wed Oct 07 15:45:55 2009 -0400
description:
log: Don't use 100% CPU when log connection closes.
diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
src/log/log-connection.c | 6 +++++-
diffs (18 lines):
diff -r 22276a4717ca -r 1aff70cee4d9 src/log/log-connection.c
--- a/src/log/log-connection.c Wed Oct 07 16:48:49 2009 +0000
+++ b/src/log/log-connection.c Wed Oct 07 15:45:55 2009 -0400
@@ -217,9 +217,13 @@ static void log_connection_input(struct
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);
}
}
More information about the dovecot-cvs
mailing list