From c0b4060d4467969abf721756f1907653519b62b3 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 20 Mar 2007 23:09:54 +0000
Subject: [PATCH] Add support for dynamic groups, which use the groupOfURLs object class and the memberURL attribute type to specify one or more LDAP URLs containing criteria for membership.

---
 opends/src/server/org/opends/server/core/SearchOperation.java |   53 +++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/SearchOperation.java b/opends/src/server/org/opends/server/core/SearchOperation.java
index bd01dcf..25e88cb 100644
--- a/opends/src/server/org/opends/server/core/SearchOperation.java
+++ b/opends/src/server/org/opends/server/core/SearchOperation.java
@@ -1115,15 +1115,27 @@
     // Send the entry to the client.
     if (pluginResult.sendEntry())
     {
-      clientConnection.sendSearchEntry(this, searchEntry);
+      try
+      {
+        clientConnection.sendSearchEntry(this, searchEntry);
 
-      // Log the entry sent to the client.
-      logSearchResultEntry(this, searchEntry);
+        // Log the entry sent to the client.
+        logSearchResultEntry(this, searchEntry);
 
-      entriesSent++;
+        entriesSent++;
+      }
+      catch (DirectoryException de)
+      {
+        if (debugEnabled())
+        {
+          debugCaught(DebugLogLevel.ERROR, de);
+        }
+
+        setResponseData(de);
+        return false;
+      }
     }
 
-
     return pluginResult.continueSearch();
   }
 
@@ -1201,19 +1213,32 @@
     // to send any more.
     if (pluginResult.sendReference())
     {
-      if (clientConnection.sendSearchReference(this, reference))
+      try
       {
-        // Log the entry sent to the client.
-        logSearchResultReference(this, reference);
-        referencesSent++;
+        if (clientConnection.sendSearchReference(this, reference))
+        {
+          // Log the entry sent to the client.
+          logSearchResultReference(this, reference);
+          referencesSent++;
 
-        // FIXME -- Should the size limit apply here?
+          // FIXME -- Should the size limit apply here?
+        }
+        else
+        {
+          // We know that the client can't handle referrals, so we won't try to
+          // send it any more.
+          clientAcceptsReferrals = false;
+        }
       }
-      else
+      catch (DirectoryException de)
       {
-        // We know that the client can't handle referrals, so we won't try to
-        // send it any more.
-        clientAcceptsReferrals = false;
+        if (debugEnabled())
+        {
+          debugCaught(DebugLogLevel.ERROR, de);
+        }
+
+        setResponseData(de);
+        return false;
       }
     }
 

--
Gitblit v1.10.0