mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
24.50.2006 bf7b61bf7e22fc0c1c0bf69255f44d0139c86937
opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -838,6 +838,10 @@
    DatabaseEntry key = new DatabaseEntry(begin);
    List<Lock> lockList = new ArrayList<Lock>(1);
    int lookthroughCount = 0;
    int lookthroughLimit =
        searchOperation.getClientConnection().getLookthroughLimit();
    try
    {
      Cursor cursor = dn2id.openCursor(null, null);
@@ -851,6 +855,15 @@
        // Step forward until we pass the ending value.
        while (status == OperationStatus.SUCCESS)
        {
          if(lookthroughLimit > 0 && lookthroughCount > lookthroughLimit)
          {
            //Lookthrough limit exceeded
            searchOperation.setResultCode(ResultCode.ADMIN_LIMIT_EXCEEDED);
            searchOperation.appendErrorMessage(
              getMessage(MSGID_JEB_LOOKTHROUGH_LIMIT_EXCEEDED,
              lookthroughLimit));
            return;
          }
          int cmp = dn2idComparator.compare(key.getData(), end);
          if (cmp >= 0)
          {
@@ -901,6 +914,8 @@
            // Process the candidate entry.
            if (entry != null)
            {
              lookthroughCount++;
              if (manageDsaIT || entry.getReferralURLs() == null)
              {
                // Filter the entry.
@@ -1023,6 +1038,18 @@
      }
    }
    // Make sure the candidate list is smaller than the lookthrough limit
    int lookthroughLimit =
        searchOperation.getClientConnection().getLookthroughLimit();
    if(lookthroughLimit > 0 && entryIDList.size() > lookthroughLimit)
    {
      //Lookthrough limit exceeded
      searchOperation.setResultCode(ResultCode.ADMIN_LIMIT_EXCEEDED);
      searchOperation.appendErrorMessage(
          getMessage(MSGID_JEB_LOOKTHROUGH_LIMIT_EXCEEDED, lookthroughLimit));
      continueSearch = false;
    }
    // Iterate through the index candidates.
    if (continueSearch)
    {