summaryrefslogtreecommitdiff
path: root/nslcd/myldap.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-12-08 22:54:06 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-12-08 22:54:06 +0000
commit226b067233bc86571f88b1ae67c0c99b3d2b27cc (patch)
tree311de14131bc7263c4a3e8c1f9ca42db22f95876 /nslcd/myldap.c
parent795e0e2046c47c78aead9865a384bc71867b948d (diff)
in each worker wake up once in a while to check whether any existing LDAP connections should be closed
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1319 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/myldap.c')
-rw-r--r--nslcd/myldap.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/nslcd/myldap.c b/nslcd/myldap.c
index 92f0154..89049cc 100644
--- a/nslcd/myldap.c
+++ b/nslcd/myldap.c
@@ -600,10 +600,7 @@ static void do_close(MYLDAP_SESSION *session)
}
}
-/* This checks the timeout value of the session and closes the connection
- to the LDAP server if the timeout has expired and there are no pending
- searches. */
-static void myldap_session_check(MYLDAP_SESSION *session)
+void myldap_session_check(MYLDAP_SESSION *session)
{
int i;
time_t current_time;
@@ -902,8 +899,10 @@ static int do_retry_search(MYLDAP_SEARCH *search)
if (nexttry>=endtime)
{
if (search->session->binddn[0]=='\0')
- log_log(LOG_ERR,"no available LDAP server found");
- return rc;
+ {
+ log_log(LOG_ERR,"no available LDAP server found: %s",ldap_err2string(rc));
+ return LDAP_UNAVAILABLE;
+ }
}
/* sleep between tries */
sleeptime=nexttry-time(NULL);