changeset 295:c6c0e376008f HEAD

close mailbox before sending "OK Logout completed", because the closing may take some time with mbox
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Sep 2002 13:30:21 +0300
parents e6a00377af97
children d66aa1f1fb2d
files src/imap/cmd-logout.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-logout.c	Mon Sep 23 13:22:37 2002 +0300
+++ b/src/imap/cmd-logout.c	Mon Sep 23 13:30:21 2002 +0300
@@ -6,6 +6,15 @@
 int cmd_logout(Client *client)
 {
 	client_send_line(client, "* BYE Logging out");
+
+	if (client->mailbox != NULL) {
+		/* this could be done at client_disconnect() as well,
+		   but eg. mbox rewrite takes a while so the waiting is
+		   better to happen before "OK" message. */
+		client->mailbox->close(client->mailbox);
+		client->mailbox = NULL;
+	}
+
 	client_send_tagline(client, "OK Logout completed.");
 	client_disconnect(client);
 	return TRUE;