Skip to content

Commit

Permalink
director: Make sure users are sorted after unfinished handshake
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen committed Nov 25, 2017
1 parent a419c03 commit 27d45a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/director/director-connection.c
Expand Up @@ -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;
Expand Down

0 comments on commit 27d45a6

Please sign in to comment.