From: Timo Sirainen Date: Tue, 27 Nov 2012 04:20:44 +0000 (+0200) Subject: doveadm-server: Avoid eating CPU when client disconnects before authentication is... X-Git-Tag: 2.1.11~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47e89f0f02ffecb174bb937eb27650c0d1621979;p=thirdparty%2Fdovecot%2Fcore.git doveadm-server: Avoid eating CPU when client disconnects before authentication is done. --- diff --git a/src/doveadm/client-connection.c b/src/doveadm/client-connection.c index d06fec6adf..cfa64a12f0 100644 --- a/src/doveadm/client-connection.c +++ b/src/doveadm/client-connection.c @@ -239,8 +239,11 @@ client_connection_authenticate(struct client_connection *conn) 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, "