changeset 7115:fc06e748f8e4 HEAD

Assert-crashfix
author Timo Sirainen <tss@iki.fi>
date Sun, 06 Jan 2008 01:38:52 +0200
parents 9bbe74f6f2a9
children df5e4bea11e2
files src/imap-login/client-authenticate.c
diffstat 1 files changed, 13 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap-login/client-authenticate.c	Sun Jan 06 01:34:51 2008 +0200
+++ b/src/imap-login/client-authenticate.c	Sun Jan 06 01:38:52 2008 +0200
@@ -77,6 +77,17 @@
 	}
 }
 
+static void client_auth_failed(struct imap_client *client)
+{
+	/* get back to normal client input. */
+	if (client->io != NULL)
+		io_remove(&client->io);
+	client->io = io_add(client->common.fd, IO_READ,
+			    client_input, client);
+
+	timeout_remove(&client->to_auth_waiting);
+}
+
 static bool client_handle_args(struct imap_client *client,
 			       const char *const *args, bool success)
 {
@@ -169,13 +180,8 @@
 
 	i_assert(nologin);
 
-	if (!client->destroyed) {
-		/* get back to normal client input. */
-		if (client->io != NULL)
-			io_remove(&client->io);
-		client->io = io_add(client->common.fd, IO_READ,
-				    client_input, client);
-	}
+	if (!client->destroyed)
+		client_auth_failed(client);
 	return TRUE;
 }
 
@@ -264,17 +270,6 @@
 	return 0;
 }
 
-static void client_auth_failed(struct imap_client *client)
-{
-	/* get back to normal client input. */
-	if (client->io != NULL)
-		io_remove(&client->io);
-	client->io = io_add(client->common.fd, IO_READ,
-			    client_input, client);
-
-	timeout_remove(&client->to_auth_waiting);
-}
-
 int cmd_authenticate(struct imap_client *client, const struct imap_arg *args)
 {
 	const char *mech_name, *init_resp = NULL;