dovecot-2.2: doveadm-server: Avoid eating CPU when client discon...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 5 01:14:34 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/0dc3f56e6468
changeset: 15521:0dc3f56e6468
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 27 06:20:44 2012 +0200
description:
doveadm-server: Avoid eating CPU when client disconnects before authentication is done.

diffstat:

 src/doveadm/client-connection.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r 275a57b8dc70 -r 0dc3f56e6468 src/doveadm/client-connection.c
--- a/src/doveadm/client-connection.c	Tue Nov 27 06:19:57 2012 +0200
+++ b/src/doveadm/client-connection.c	Tue Nov 27 06:20:44 2012 +0200
@@ -239,8 +239,11 @@
 	const unsigned char *data;
 	size_t size;
 
-	if ((line = i_stream_read_next_line(conn->input)) == NULL)
+	if ((line = i_stream_read_next_line(conn->input)) == NULL) {
+		if (conn->input->eof)
+			return -1;
 		return 0;
+	}
 
 	if (*conn->set->doveadm_password == '\0') {
 		i_error("doveadm_password not set, "


More information about the dovecot-cvs mailing list