Module: kamailio Branch: 4.2 Commit: b2aa72a6357dd93c75a345fd433c3b86c2654313 URL: https://github.com/kamailio/kamailio/commit/b2aa72a6357dd93c75a345fd433c3b86...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-03-10T14:56:38+01:00
ldap: more useful info on reconnect
- reconnect message made a notice level, being not an error situation - print the chosen ldap server address at info level when reconnecting
(cherry picked from commit c5ae4020de8499e7a318783b21276dfd3fc0a6e3)
---
Modified: modules/ldap/ldap_connect.c
---
Diff: https://github.com/kamailio/kamailio/commit/b2aa72a6357dd93c75a345fd433c3b86... Patch: https://github.com/kamailio/kamailio/commit/b2aa72a6357dd93c75a345fd433c3b86...
---
diff --git a/modules/ldap/ldap_connect.c b/modules/ldap/ldap_connect.c index 9799adf..53d4f98 100644 --- a/modules/ldap/ldap_connect.c +++ b/modules/ldap/ldap_connect.c @@ -41,7 +41,7 @@ #include "../../mem/mem.h" #include "../../ut.h"
-int ldap_connect(char* _ld_name) +int ldap_connect_ex(char* _ld_name, int llevel) { int rc; int ldap_bind_result_code; @@ -226,13 +226,18 @@ int ldap_connect(char* _ld_name) /* ldap_msgfree(result); */
- LM_DBG( "[%s]: LDAP bind successful (ldap_host [%s])\n", + LOG(llevel, "[%s]: LDAP bind successful (ldap_host [%s])\n", _ld_name, lds->host_name);
return 0; }
+int ldap_connect(char* _ld_name) +{ + return ldap_connect(_ld_name, L_DBG); +} + int ldap_disconnect(char* _ld_name) { struct ld_session* lds; @@ -267,14 +272,14 @@ int ldap_reconnect(char* _ld_name) return -1; }
- if ((rc = ldap_connect(_ld_name)) != 0) + if ((rc = ldap_connect_ex(_ld_name, L_INFO)) != 0) { LM_ERR("[%s]: reconnect failed\n", _ld_name); } else { - LM_ERR("[%s]: LDAP reconnect successful\n", + LM_NOTICE("[%s]: LDAP reconnect successful\n", _ld_name); } return rc;