Fix pagedresults resume

This commit is contained in:
Howard Chu 2007-11-12 11:45:12 +00:00
parent 7aeb9bf621
commit 74f54320cd

View File

@ -612,26 +612,15 @@ dn2entry_retry:
goto done; goto done;
} }
if ( (ID)( ps->ps_cookie ) == 0 ) { cursor = (ID) ps->ps_cookie;
id = bdb_idl_first( candidates, &cursor ); if ( cursor && ps->ps_size == 0 ) {
rs->sr_err = LDAP_SUCCESS;
} else { rs->sr_text = "search abandoned by pagedResult size=0";
if ( ps->ps_size == 0 ) { send_ldap_result( op, rs );
rs->sr_err = LDAP_SUCCESS; goto done;
rs->sr_text = "search abandoned by pagedResult size=0";
send_ldap_result( op, rs );
goto done;
}
for ( id = bdb_idl_first( candidates, &cursor );
id != NOID &&
id <= (ID)( ps->ps_cookie );
id = bdb_idl_next( candidates, &cursor ) )
{
/* empty */;
}
} }
id = bdb_idl_first( candidates, &cursor );
if ( cursor == NOID ) { if ( id == NOID ) {
Debug( LDAP_DEBUG_TRACE, Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_search) LDAP_XSTRING(bdb_search)
": no paged results candidates\n", ": no paged results candidates\n",
@ -642,6 +631,8 @@ dn2entry_retry:
goto done; goto done;
} }
nentries = ps->ps_count; nentries = ps->ps_count;
if ( id == (ID)ps->ps_cookie )
id = bdb_idl_next( candidates, &cursor );
goto loop_begin; goto loop_begin;
} }