]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Split off proxy_reset()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 14 May 2020 15:31:23 +0000 (18:31 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 17 Jan 2022 11:52:08 +0000 (13:52 +0200)
It doesn't harm to call client_vfuncs.proxy_reset() also on non-reconnect
case.

src/login-common/client-common-auth.c

index d606ccb901aa4bf9bdb6962c47b515255ef894bc..db504a390f0fd26d0f21a7197a88784c9af33180 100644 (file)
@@ -387,17 +387,21 @@ static void proxy_input(struct client *client)
        i_stream_unref(&input);
 }
 
+static void proxy_reset(struct client *client)
+{
+       if (client->proxy_sasl_client != NULL)
+               dsasl_client_free(&client->proxy_sasl_client);
+       client->v.proxy_reset(client);
+}
+
 void client_common_proxy_failed(struct client *client,
                                enum login_proxy_failure_type type,
                                const char *reason ATTR_UNUSED,
                                bool reconnecting)
 {
-       if (client->proxy_sasl_client != NULL)
-               dsasl_client_free(&client->proxy_sasl_client);
-       if (reconnecting) {
-               client->v.proxy_reset(client);
+       proxy_reset(client);
+       if (reconnecting)
                return;
-       }
 
        switch (type) {
        case LOGIN_PROXY_FAILURE_TYPE_CONNECT: