bool debug);
void auth_client_deinit(struct auth_client **client);
+void auth_client_disconnect(struct auth_client *client);
bool auth_client_is_connected(struct auth_client *client);
void auth_client_set_connect_notify(struct auth_client *client,
auth_connect_notify_callback_t *callback,
#define AUTH_SERVER_RECONNECT_TIMEOUT_SECS 5
static void
-auth_server_connection_disconnect(struct auth_server_connection *conn);
+auth_server_connection_reconnect(struct auth_server_connection *conn);
static int
auth_server_input_mech(struct auth_server_connection *conn,
return;
case -1:
/* disconnected */
- auth_server_connection_disconnect(conn);
+ auth_server_connection_reconnect(conn);
return;
case -2:
/* buffer full - can't happen unless auth is buggy */
hash_table_clear(conn->requests, FALSE);
}
-static void auth_server_connection_close(struct auth_server_connection *conn)
+void auth_server_connection_disconnect(struct auth_server_connection *conn)
{
conn->handshake_received = FALSE;
conn->version_received = FALSE;
}
static void
-auth_server_connection_disconnect(struct auth_server_connection *conn)
+auth_server_connection_reconnect(struct auth_server_connection *conn)
{
time_t next_connect;
- auth_server_connection_close(conn);
+ auth_server_connection_disconnect(conn);
next_connect = conn->last_connect + AUTH_SERVER_RECONNECT_TIMEOUT_SECS;
conn->to = timeout_add(ioloop_time >= next_connect ? 0 :
*_conn = NULL;
- auth_server_connection_close(conn);
-
+ auth_server_connection_disconnect(conn);
hash_table_destroy(&conn->requests);
array_free(&conn->available_auth_mechs);
pool_unref(&conn->pool);
i_error("Timeout waiting for handshake from auth server. "
"my pid=%u, input bytes=%"PRIuUOFF_T,
conn->client->client_pid, conn->input->v_offset);
- auth_server_connection_disconnect(conn);
+ auth_server_connection_reconnect(conn);
}
int auth_server_connection_connect(struct auth_server_connection *conn)