r15241: Add helper function to set reconnect status defaults
authorSimo Sorce <idra@samba.org>
Tue, 25 Apr 2006 12:34:13 +0000 (12:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:04:23 +0000 (14:04 -0500)
source/libcli/ldap/ldap_client.c

index 344605f4ec83a28b3462fb382b97f32c94a45e9c..74ac64a68dfa2915ffaddbda110f4a956e03b12e 100644 (file)
@@ -438,6 +438,17 @@ NTSTATUS ldap_connect(struct ldap_connection *conn, const char *url)
        return ldap_connect_recv(ctx);
 }
 
+/* set reconnect parameters */
+
+void ldap_set_reconn_params(struct ldap_connection *conn, int max_retries)
+{
+       if (conn) {
+               conn->reconnect.max_retries = max_retries;
+               conn->reconnect.retries = 0;
+               conn->reconnect.previous = time(NULL);
+       }
+}
+
 /* Actually this function is NOT ASYNC safe, FIXME? */
 static void ldap_reconnect(struct ldap_connection *conn)
 {