dovecot-2.0-sslstream: lmtp proxy: Error handling fix.

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:56:41 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/9500cfbe5dbf
changeset: 10398:9500cfbe5dbf
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 24 13:29:02 2009 -0500
description:
lmtp proxy: Error handling fix.

diffstat:

3 files changed, 6 insertions(+), 4 deletions(-)
src/lib-lda/lmtp-client.c |    2 +-
src/lib-lda/lmtp-client.h |    1 +
src/lmtp/lmtp-proxy.c     |    7 ++++---

diffs (48 lines):

diff -r 6ab1e2f4ca55 -r 9500cfbe5dbf src/lib-lda/lmtp-client.c
--- a/src/lib-lda/lmtp-client.c	Mon Nov 23 18:19:01 2009 -0500
+++ b/src/lib-lda/lmtp-client.c	Tue Nov 24 13:29:02 2009 -0500
@@ -83,7 +83,7 @@ lmtp_client_init(const char *mail_from, 
 	return client;
 }
 
-static void lmtp_client_close(struct lmtp_client *client)
+void lmtp_client_close(struct lmtp_client *client)
 {
 	if (client->io != NULL)
 		io_remove(&client->io);
diff -r 6ab1e2f4ca55 -r 9500cfbe5dbf src/lib-lda/lmtp-client.h
--- a/src/lib-lda/lmtp-client.h	Mon Nov 23 18:19:01 2009 -0500
+++ b/src/lib-lda/lmtp-client.h	Tue Nov 24 13:29:02 2009 -0500
@@ -21,6 +21,7 @@ int lmtp_client_connect_tcp(struct lmtp_
 int lmtp_client_connect_tcp(struct lmtp_client *client,
 			    enum lmtp_client_protocol protocol,
 			    const char *host, unsigned int port);
+void lmtp_client_close(struct lmtp_client *client);
 
 /* Add headers from given string before the rest of the data. The string must
    use CRLF line feeds and end with CRLF. */
diff -r 6ab1e2f4ca55 -r 9500cfbe5dbf src/lmtp/lmtp-proxy.c
--- a/src/lmtp/lmtp-proxy.c	Mon Nov 23 18:19:01 2009 -0500
+++ b/src/lmtp/lmtp-proxy.c	Tue Nov 24 13:29:02 2009 -0500
@@ -81,8 +81,10 @@ static void lmtp_proxy_connections_deini
 	unsigned int i, count;
 
 	conns = array_get(&proxy->connections, &count);
-	for (i = 0; i < count; i++)
+	for (i = 0; i < count; i++) {
 		lmtp_client_fail(conns[i]->client, "451 4.3.0 Aborting");
+		lmtp_client_deinit(&conns[i]->client);
+	}
 }
 
 void lmtp_proxy_deinit(struct lmtp_proxy **_proxy)
@@ -146,8 +148,7 @@ lmtp_proxy_get_connection(struct lmtp_pr
 
 static void lmtp_proxy_conn_close(struct lmtp_proxy_connection *conn)
 {
-	if (conn->client != NULL)
-		lmtp_client_deinit(&conn->client);
+	lmtp_client_close(conn->client);
 	if (conn->data_input != NULL)
 		i_stream_unref(&conn->data_input);
 }


More information about the dovecot-cvs mailing list