projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
301afa2
)
We now try to reconnect to the ldap server if it got restarted
author
Dave West
<davew@uncensored.citadel.org>
Sat, 6 Oct 2007 18:28:43 +0000
(18:28 +0000)
committer
Dave West
<davew@uncensored.citadel.org>
Sat, 6 Oct 2007 18:28:43 +0000
(18:28 +0000)
since the last time we accessed it.
citadel/modules/ldap/serv_ldap.c
patch
|
blob
|
history
diff --git
a/citadel/modules/ldap/serv_ldap.c
b/citadel/modules/ldap/serv_ldap.c
index 7e3634ec7eae12215fc2a4ada87b63f4d5010e6d..9008ac95efe19eb466af6b8c4a9c3bdb60a177f8 100644
(file)
--- a/
citadel/modules/ldap/serv_ldap.c
+++ b/
citadel/modules/ldap/serv_ldap.c
@@
-422,6
+422,16
@@
int CtdlDeleteFromLdap(char *cn, char *ou, void **object)
i = ldap_delete_s(dirserver, this_dn);
end_critical_section(S_LDAP);
+ if (i == LDAP_SERVER_DOWN)
+ { // failed to connect so try to re init the connection
+ serv_ldap_cleanup();
+ CtdlConnectToLdap();
+ // And try the delete again.
+ begin_critical_section(S_LDAP);
+ i = ldap_delete_s(dirserver, this_dn);
+ end_critical_section(S_LDAP);
+ }
+
if (i != LDAP_SUCCESS) {
lprintf(CTDL_ERR, "LDAP: ldap_delete_s() failed: %s (%d)\n",
ldap_err2string(i), i);