Module: kamailio Branch: master Commit: c5ae4020de8499e7a318783b21276dfd3fc0a6e3 URL: https://github.com/kamailio/kamailio/commit/c5ae4020de8499e7a318783b21276dfd...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-03-10T14:52:08+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
---
Modified: modules/ldap/ldap_connect.c
---
Diff: https://github.com/kamailio/kamailio/commit/c5ae4020de8499e7a318783b21276dfd... Patch: https://github.com/kamailio/kamailio/commit/c5ae4020de8499e7a318783b21276dfd...
---
diff --git a/modules/ldap/ldap_connect.c b/modules/ldap/ldap_connect.c index 4ffff28..d2ae164 100644 --- a/modules/ldap/ldap_connect.c +++ b/modules/ldap/ldap_connect.c @@ -36,7 +36,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; @@ -221,13 +221,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; @@ -262,14 +267,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;