ldap/servers/slapd/connection.c | 2 ++
ldap/servers/slapd/daemon.c | 3 ++-
ldap/servers/slapd/pagedresults.c | 4 ++--
3 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 68d53e39a919560741e47668b8a46b59f4ced524
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Jan 31 09:26:07 2011 -0800
Bug 668619 - slapd stops responding
https://bugzilla.redhat.com/show_bug.cgi?id=668619
Description: The server uses c_timelimit field in the connection
table element to check the staled Simple Paged Results request.
The field is supposed to be cleaned up when the staled Simple
Paged Results connection is disconnected. But the cleanup was
sometimes incomplete. It causes the following requests which
happens to acquire the same connection table element timed out.
This patch forces to clean up the c_timelimit every time the
connection table is acquired and renewed. Also, the timeout
check is done only for the Simple Paged Results connection.
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 519546b..7b00a21 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -2721,6 +2721,8 @@ disconnect_server_nomutex( Connection *conn, PRUint64 opconnid, int
opid, PRErro
if ( ( conn->c_sd != SLAPD_INVALID_SOCKET &&
conn->c_connid == opconnid ) && !(conn->c_flags & CONN_FLAG_CLOSING) )
{
+ pagedresults_cleanup(conn); /* In case the connection is on pagedresult */
+
/*
* PR_Close must be called before anything else is done because
* of NSPR problem on NT which requires that the socket on which
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 0242902..6678269 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1221,7 +1221,8 @@ setup_pr_read_pds(Connection_Table *ct, PRFileDesc **n_tcps,
PRFileDesc **s_tcps
c->c_fdi = SLAPD_INVALID_SOCKET_INDEX;
}
}
- if (c->c_timelimit > 0) /* check timeout for PAGED RESULTS */
+ /* check timeout for PAGED RESULTS */
+ if (c->c_current_be && (c->c_timelimit > 0))
{
time_t ctime = current_time();
if (ctime > c->c_timelimit)
diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c
index 47b3490..a1b0333 100644
--- a/ldap/servers/slapd/pagedresults.c
+++ b/ldap/servers/slapd/pagedresults.c
@@ -381,9 +381,9 @@ pagedresults_cleanup(Connection *conn)
conn->c_search_result_set = NULL;
}
conn->c_current_be = 0;
- conn->c_search_result_count = 0;
- conn->c_timelimit = 0;
rc = 1;
}
+ conn->c_search_result_count = 0;
+ conn->c_timelimit = 0;
return rc;
}