dovecot-2.0: imap, pop3, lmtp: Close network sockets with net_di...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 17 16:47:31 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/b2ffb6846973
changeset: 11565:b2ffb6846973
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 17 14:47:27 2010 +0100
description:
imap, pop3, lmtp: Close network sockets with net_disconnect().

diffstat:

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

diffs (57 lines):

diff -r c24ee1ebb159 -r b2ffb6846973 src/imap/imap-client.c
--- a/src/imap/imap-client.c	Thu Jun 17 14:47:16 2010 +0100
+++ b/src/imap/imap-client.c	Thu Jun 17 14:47:27 2010 +0100
@@ -211,12 +211,9 @@
 	i_stream_destroy(&client->input);
 	o_stream_destroy(&client->output);
 
-	if (close(client->fd_in) < 0)
-		i_error("close(client in) failed: %m");
-	if (client->fd_in != client->fd_out) {
-		if (close(client->fd_out) < 0)
-			i_error("close(client out) failed: %m");
-	}
+	net_disconnect(client->fd_in);
+	if (client->fd_in != client->fd_out)
+		net_disconnect(client->fd_out);
 
 	if (array_is_created(&client->search_saved_uidset))
 		array_free(&client->search_saved_uidset);
diff -r c24ee1ebb159 -r b2ffb6846973 src/lmtp/client.c
--- a/src/lmtp/client.c	Thu Jun 17 14:47:16 2010 +0100
+++ b/src/lmtp/client.c	Thu Jun 17 14:47:27 2010 +0100
@@ -260,12 +260,9 @@
 	i_stream_destroy(&client->input);
 	o_stream_destroy(&client->output);
 
-	if (close(client->fd_in) < 0)
-		i_error("close(client in) failed: %m");
-	if (client->fd_in != client->fd_out) {
-		if (close(client->fd_out) < 0)
-			i_error("close(client out) failed: %m");
-	}
+	net_disconnect(client->fd_in);
+	if (client->fd_in != client->fd_out)
+		net_disconnect(client->fd_out);
 	client_state_reset(client);
 	pool_unref(&client->state_pool);
 	pool_unref(&client->pool);
diff -r c24ee1ebb159 -r b2ffb6846973 src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Thu Jun 17 14:47:16 2010 +0100
+++ b/src/pop3/pop3-client.c	Thu Jun 17 14:47:27 2010 +0100
@@ -425,12 +425,9 @@
 	i_stream_destroy(&client->input);
 	o_stream_destroy(&client->output);
 
-	if (close(client->fd_in) < 0)
-		i_error("close(client in) failed: %m");
-	if (client->fd_in != client->fd_out) {
-		if (close(client->fd_out) < 0)
-			i_error("close(client out) failed: %m");
-	}
+	net_disconnect(client->fd_in);
+	if (client->fd_in != client->fd_out)
+		net_disconnect(client->fd_out);
 	mail_storage_service_user_free(&client->service_user);
 	i_free(client);
 


More information about the dovecot-cvs mailing list