From b2aa72a6357dd93c75a345fd433c3b86c2654313 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 10 Mar 2015 14:52:08 +0100 Subject: [PATCH] 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) --- modules/ldap/ldap_connect.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/ldap/ldap_connect.c b/modules/ldap/ldap_connect.c index 9799adfbd02..53d4f98c1e4 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;