dovecot-2.2: director: Minor code cleanup - allow access to auth...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 13 12:35:33 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/d54dc360cd3c
changeset: 18670:d54dc360cd3c
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 13 13:57:24 2015 +0300
description:
director: Minor code cleanup - allow access to auth connection's ostream directly.

diffstat:

 src/director/auth-connection.c  |  8 +++-----
 src/director/auth-connection.h  |  5 ++---
 src/director/login-connection.c |  4 +++-
 3 files changed, 8 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r 67fdd6f962f5 -r d54dc360cd3c src/director/auth-connection.c
--- a/src/director/auth-connection.c	Wed May 13 13:15:57 2015 +0300
+++ b/src/director/auth-connection.c	Wed May 13 13:57:24 2015 +0300
@@ -121,12 +121,10 @@
 	conn->callback(NULL, conn->context);
 }
 
-void auth_connection_send(struct auth_connection *conn,
-			  const void *data, size_t size)
+struct ostream *auth_connection_get_output(struct auth_connection *conn)
 {
-	i_assert(conn->fd != -1);
-
-	o_stream_nsend(conn->output, data, size);
+	i_assert(conn->output != NULL);
+	return conn->output;
 }
 
 void auth_connections_deinit(void)
diff -r 67fdd6f962f5 -r d54dc360cd3c src/director/auth-connection.h
--- a/src/director/auth-connection.h	Wed May 13 13:15:57 2015 +0300
+++ b/src/director/auth-connection.h	Wed May 13 13:57:24 2015 +0300
@@ -13,9 +13,8 @@
 
 /* Start connecting. Returns 0 if ok, -1 if connect failed. */
 int auth_connection_connect(struct auth_connection *conn);
-/* Send data to auth connection. */
-void auth_connection_send(struct auth_connection *conn,
-			  const void *data, size_t size);
+/* Get auth connection's output stream. */
+struct ostream *auth_connection_get_output(struct auth_connection *conn);
 
 void auth_connections_deinit(void);
 
diff -r 67fdd6f962f5 -r d54dc360cd3c src/director/login-connection.c
--- a/src/director/login-connection.c	Wed May 13 13:15:57 2015 +0300
+++ b/src/director/login-connection.c	Wed May 13 13:57:24 2015 +0300
@@ -44,6 +44,7 @@
 
 static void login_connection_input(struct login_connection *conn)
 {
+	struct ostream *output;
 	unsigned char buf[4096];
 	ssize_t ret;
 
@@ -58,7 +59,8 @@
 		login_connection_deinit(&conn);
 		return;
 	}
-	auth_connection_send(conn->auth, buf, ret);
+	output = auth_connection_get_output(conn->auth);
+	o_stream_nsend(output, buf, ret);
 }
 
 static void


More information about the dovecot-cvs mailing list