dovecot-2.0: auth client: Added asserts.

dovecot at dovecot.org dovecot at dovecot.org
Thu Dec 10 03:19:09 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/3ac17da0d723
changeset: 10447:3ac17da0d723
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Dec 09 20:11:08 2009 -0500
description:
auth client: Added asserts.

diffstat:

1 file changed, 6 insertions(+)
src/lib-auth/auth-client.c |    6 ++++++

diffs (28 lines):

diff -r b15a3277d7d4 -r 3ac17da0d723 src/lib-auth/auth-client.c
--- a/src/lib-auth/auth-client.c	Wed Dec 09 20:06:20 2009 -0500
+++ b/src/lib-auth/auth-client.c	Wed Dec 09 20:11:08 2009 -0500
@@ -48,6 +48,8 @@ auth_client_get_available_mechs(struct a
 auth_client_get_available_mechs(struct auth_client *client,
 				unsigned int *mech_count)
 {
+	i_assert(auth_client_is_connected(client));
+
 	return array_get(&client->conn->available_auth_mechs, mech_count);
 }
 
@@ -67,11 +69,15 @@ void auth_client_get_connect_id(struct a
 				unsigned int *server_pid_r,
 				unsigned int *connect_uid_r)
 {
+	i_assert(auth_client_is_connected(client));
+
 	*server_pid_r = client->conn->server_pid;
 	*connect_uid_r = client->conn->connect_uid;
 }
 
 const char *auth_client_get_cookie(struct auth_client *client)
 {
+	i_assert(auth_client_is_connected(client));
+
 	return client->conn->cookie;
 }


More information about the dovecot-cvs mailing list