]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth: Fix auth_client_is_connected() to work after disconnection
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 4 Sep 2019 14:13:15 +0000 (17:13 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 23 Sep 2019 05:48:01 +0000 (08:48 +0300)
src/lib-auth/auth-client.c

index 4642aca8b6980fb7bea207614327574cbe3b409e..4f49f855013769e31e6d00cba309a26758707d61 100644 (file)
@@ -56,7 +56,9 @@ void auth_client_disconnect(struct auth_client *client, const char *reason)
 
 bool auth_client_is_connected(struct auth_client *client)
 {
-       return client->conn->conn.handshake_received;
+       /* handshake_received isn't unset immediately after disconnection */
+       return client->conn->conn.handshake_received &&
+               client->conn->connected;
 }
 
 bool auth_client_is_disconnected(struct auth_client *client)