summaryrefslogtreecommitdiff
path: root/modules/extra/m_ldap_authentication.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-10 23:08:00 -0400
committerAdam <Adam@anope.org>2012-10-10 23:08:00 -0400
commit757ff06011c9b6ac8f66da7a5cac03597194d97a (patch)
tree89553068f751967fe741da50bb835beb589b9552 /modules/extra/m_ldap_authentication.cpp
parent06defe014bf4f74b645429593670fa74803c6758 (diff)
Fix m_ldap to reconnect automatically if the ldap server goes away
Diffstat (limited to 'modules/extra/m_ldap_authentication.cpp')
-rw-r--r--modules/extra/m_ldap_authentication.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp
index 2ca08f975..5469713e2 100644
--- a/modules/extra/m_ldap_authentication.cpp
+++ b/modules/extra/m_ldap_authentication.cpp
@@ -85,11 +85,18 @@ class IdentifyInterface : public LDAPInterface
if (ii->admin_bind)
{
Anope::string sf = search_filter.replace_all_cs("%account", ii->req->GetAccount()).replace_all_cs("%object_class", object_class);
- Log(LOG_DEBUG) << "m_ldap_authentication: searching for " << sf;
- LDAPQuery id = ii->lprov->Search(this, basedn, sf);
- this->Add(id, ii);
- ii->admin_bind = false;
- return;
+ try
+ {
+ Log(LOG_DEBUG) << "m_ldap_authentication: searching for " << sf;
+ LDAPQuery id = ii->lprov->Search(this, basedn, sf);
+ this->Add(id, ii);
+ ii->admin_bind = false;
+ return;
+ }
+ catch (const LDAPException &ex)
+ {
+ Log() << "m_ldap_authentication: Unable to search for " << sf << ": " << ex.GetReason();
+ }
}
else
{
@@ -261,7 +268,7 @@ class NSIdentifyLDAP : public Module
catch (const LDAPException &ex)
{
delete ii;
- Log() << "ns_identify_ldap: " << ex.GetReason();
+ Log() << "m_ldap_authentication: " << ex.GetReason();
}
}