changeset 158:a1204e882bc7 HEAD

Flush output buffer to client at exit, and send a nice "BYE Server shutting down." message when we're being killed.
author Timo Sirainen <tss@iki.fi>
date Thu, 05 Sep 2002 15:52:49 +0300
parents 2800791d1b31
children e0193106a95d
files src/imap/client.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/client.c	Thu Sep 05 15:47:54 2002 +0300
+++ b/src/imap/client.c	Thu Sep 05 15:52:49 2002 +0300
@@ -59,6 +59,8 @@
 
 void client_destroy(Client *client)
 {
+	io_buffer_send_flush(client->outbuf);
+
 	if (client->mailbox != NULL)
 		client->mailbox->close(client->mailbox);
 	mail_storage_destroy(client->storage);
@@ -353,8 +355,10 @@
 
 void clients_deinit(void)
 {
-	if (my_client != NULL)
+	if (my_client != NULL) {
+		client_send_line(my_client, "* BYE Server shutting down.");
 		client_destroy(my_client);
+	}
 
 	timeout_remove(to_idle);
 }