From: Timo Sirainen Date: Fri, 17 Nov 2017 16:53:18 +0000 (+0200) Subject: director: Make sure users are sorted after unfinished handshake X-Git-Tag: 2.2.34~220 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=27d45a6cee1b198be054d596ecac3aa18d9570a2;p=thirdparty%2Fdovecot%2Fcore.git director: Make sure users are sorted after unfinished handshake The users were sorted after the handshake was finished, but if the connection was closed before that hapepned, the users were left unsorted. This could have caused the users to not expire early enough. --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 62eaf25bb2..28af1f238e 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -2241,6 +2241,12 @@ void director_connection_deinit(struct director_connection **_conn, if (dir->right == conn) dir->right = NULL; + if (conn->users_unsorted) { + /* Users were received, but handshake didn't finish. + Finish sorting so the users won't stay in wrong order. */ + mail_hosts_sort_users(conn->dir->mail_hosts); + } + if (conn->connect_request_to != NULL) { director_host_unref(conn->connect_request_to); conn->connect_request_to = NULL;