[Date Prev][Date Next] [Chronological] [Thread] [Top]

ldap_result() fails on large results



Hi

I'm doing a search with ldap_search_ext() which returns 1000 results.
The problem is, that ldap_result() fails during processing the results
and returns with -1 and zero for the LDAPMessage.
If I'm doing a sleep between calling ldap_search_ext() and ldap_result()
for at least 500ms everything works. It works too, if I limit the amount
of results on calling ldap_search_ext() with sizelimit set to 500.
Both "solutions" do not help because I don't want to limit the amount of
results and doing a sleep... :-(

Had anybody similar problems or is there even a solution around this?

Thanks in advance.

Patrick


Platform:		WinXP
OpenLDAP version:	2.1.19

Where some debugging got me too:

Call stack:
 - ldap_result()
 - wait4msg()
 - try_read1msg()
 - ber_get_next()

wait4msg() (result.c v 1.64.2.12)
==========
Line 350:
  if ( lc->lconn_status ==
      LDAP_CONNST_CONNECTED &&
      ldap_is_read_ready( ld,
      lc->lconn_sb )) {
    rc = try_read1msg( ld, msgid, all,
        lc->lconn_sb, lc, result );
  }

try_read1msg() returns with -1.

read1msg() (result.c v 1.64.2.12)
==========
Line 445:
  if ( (tag = ber_get_next( sb, &len, ber ))
      != LDAP_TAG_MESSAGE ) {
    if ( tag == LBER_DEFAULT) {

ber_get_next() returns with LBER_DEFAULT.

ber_get_next() (io.c v 1.70.2.10)
==============
Line 641:
  if ((ber->ber_rwptr>=ber->ber_buf) && (ber->ber_rwptr<ber->ber_end)) {

ber->ber_rwptr is not between ber->ber_buf and ber->ber_end and so the
line 680

  assert( 0 ); /* ber structure is messed up ?*/
  return LBER_DEFAULT;

is reached.