# HG changeset patch # User Timo Sirainen # Date 1431514644 -10800 # Node ID d54dc360cd3caa8a795f55bead4f722d004d790e # Parent 67fdd6f962f5beb422bff74c9900defb37ba2d1e director: Minor code cleanup - allow access to auth connection's ostream directly. 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