summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2005-10-06 17:36:20 +0000
committerNathan Kinder <nkinder@redhat.com>2005-10-06 17:36:20 +0000
commit91642e09933e849690540b4434b3c879522aa22f (patch)
tree037da0df0a497f751a0f5be15db641fa19ad6929
parent1d420e45e061a0806c265a788fddb853b0063970 (diff)
downloadds-91642e09933e849690540b4434b3c879522aa22f.tar.gz
ds-91642e09933e849690540b4434b3c879522aa22f.tar.xz
ds-91642e09933e849690540b4434b3c879522aa22f.zip
169954 - Winsync initialization would hang with certain entries. Fixed improper use of ldap_get_next.
-rw-r--r--ldap/servers/plugins/replication/windows_connection.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c
index db5ba84d..779ba374 100644
--- a/ldap/servers/plugins/replication/windows_connection.c
+++ b/ldap/servers/plugins/replication/windows_connection.c
@@ -553,6 +553,9 @@ windows_search_entry(Repl_Connection *conn, char* searchbase, char *filter, Slap
int ldap_rc = 0;
LDAPMessage *res = NULL;
int not_unique = 0;
+ int nummessages = 0;
+ int numentries = 0;
+ int numreferences = 0;
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_search_entry\n", 0, 0, 0 );
@@ -566,8 +569,14 @@ windows_search_entry(Repl_Connection *conn, char* searchbase, char *filter, Slap
&conn->timeout, 0 /* sizelimit */, &res);
if (LDAP_SUCCESS == ldap_rc)
{
+ if (slapi_is_loglevel_set(SLAPI_LOG_REPL)) {
+ nummessages = ldap_count_messages(conn->ld, res);
+ numentries = ldap_count_entries(conn->ld, res);
+ numreferences = ldap_count_references(conn->ld, res);
+ LDAPDebug( LDAP_DEBUG_REPL, "windows_search_entry: recieved %d messages, %d entries, %d references\n",
+ nummessages, numentries, numreferences );
+ }
LDAPMessage *message = ldap_first_entry(conn->ld, res);
- LDAPMessage *next_entry = NULL;
if (NULL != entry)
{
*entry = windows_LDAPMessage2Entry(conn->ld,message,0);
@@ -575,7 +584,7 @@ windows_search_entry(Repl_Connection *conn, char* searchbase, char *filter, Slap
/* See if there are any more entries : if so then that's an error
* but we still need to get them to avoid gumming up the connection
*/
- while (NULL != ( next_entry = ldap_next_entry(conn->ld,res)))
+ while (NULL != ( message = ldap_next_entry(conn->ld,message)))
{
not_unique = 1;
}