dovecot-2.0: imap, pop3: Forced disconnection of client didn't a...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 28 18:25:42 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/f4238836c566
changeset: 11645:f4238836c566
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 28 16:25:35 2010 +0100
description:
imap, pop3: Forced disconnection of client didn't always close connection immediately.

diffstat:

 src/imap/imap-client.c |  9 +++++++++
 src/pop3/pop3-client.c |  9 +++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (52 lines):

diff -r be2b7d2901a0 -r f4238836c566 src/imap/imap-client.c
--- a/src/imap/imap-client.c	Mon Jun 28 13:56:39 2010 +0000
+++ b/src/imap/imap-client.c	Mon Jun 28 16:25:35 2010 +0100
@@ -227,6 +227,11 @@
 	imap_refresh_proctitle();
 }
 
+static void client_destroy_timeout(struct client *client)
+{
+	client_destroy(client, NULL);
+}
+
 void client_disconnect(struct client *client, const char *reason)
 {
 	i_assert(reason != NULL);
@@ -240,6 +245,10 @@
 
 	i_stream_close(client->input);
 	o_stream_close(client->output);
+
+	if (client->to_idle != NULL)
+		timeout_remove(&client->to_idle);
+	client->to_idle = timeout_add(0, client_destroy_timeout, client);
 }
 
 void client_disconnect_with_error(struct client *client, const char *msg)
diff -r be2b7d2901a0 -r f4238836c566 src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Mon Jun 28 13:56:39 2010 +0000
+++ b/src/pop3/pop3-client.c	Mon Jun 28 16:25:35 2010 +0100
@@ -435,6 +435,11 @@
 	pop3_refresh_proctitle();
 }
 
+static void client_destroy_timeout(struct client *client)
+{
+	client_destroy(client, NULL);
+}
+
 void client_disconnect(struct client *client, const char *reason)
 {
 	if (client->disconnected)
@@ -447,6 +452,10 @@
 
 	i_stream_close(client->input);
 	o_stream_close(client->output);
+
+	if (client->to_idle != NULL)
+		timeout_remove(&client->to_idle);
+	client->to_idle = timeout_add(0, client_destroy_timeout, client);
 }
 
 int client_send_line(struct client *client, const char *fmt, ...)


More information about the dovecot-cvs mailing list