From 5af12a9fa7a2e37c72deac0216bec19c47a9addc Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 7 Oct 2009 17:44:01 -0400 Subject: [PATCH] auth: VERSION should have been sent before MECH, not after. --HG-- branch : HEAD --- src/auth/auth-client-connection.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/auth/auth-client-connection.c b/src/auth/auth-client-connection.c index b8561ee40a..1ebc1c28d1 100644 --- a/src/auth/auth-client-connection.c +++ b/src/auth/auth-client-connection.c @@ -268,7 +268,6 @@ auth_client_connection_create(struct auth *auth, int fd) { static unsigned int connect_uid_counter = 0; struct auth_client_connection *conn; - struct const_iovec iov[2]; string_t *str; conn = i_new(struct auth_client_connection, 1); @@ -286,17 +285,13 @@ auth_client_connection_create(struct auth *auth, int fd) array_append(&auth_client_connections, &conn, 1); str = t_str_new(128); - str_printfa(str, "VERSION\t%u\t%u\nSPID\t%s\nCUID\t%u\nDONE\n", + str_printfa(str, "VERSION\t%u\t%u\n%sSPID\t%s\nCUID\t%u\nDONE\n", AUTH_CLIENT_PROTOCOL_MAJOR_VERSION, AUTH_CLIENT_PROTOCOL_MINOR_VERSION, + str_c(conn->auth->mech_handshake), my_pid, conn->connect_uid); - iov[0].iov_base = str_data(conn->auth->mech_handshake); - iov[0].iov_len = str_len(conn->auth->mech_handshake); - iov[1].iov_base = str_data(str); - iov[1].iov_len = str_len(str); - - if (o_stream_sendv(conn->output, iov, 2) < 0) + if (o_stream_send(conn->output, str_data(str), str_len(str)) < 0) auth_client_connection_destroy(&conn); return conn; -- 2.47.3