directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r940480 - in /directory: clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/ shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/
Date Mon, 03 May 2010 15:10:59 GMT
Author: elecharny
Date: Mon May  3 15:10:59 2010
New Revision: 940480

URL: http://svn.apache.org/viewvc?rev=940480&view=rev
Log:
Don't close the cursor when not needed, to avoid sending an AbandonRequest

Modified:
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/DefaultClosureMonitor.java

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=940480&r1=940479&r2=940480&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Mon May  3 15:10:59 2010
@@ -2911,11 +2911,18 @@ public class LdapNetworkConnection exten
         try
         {
             Cursor<SearchResponse> cursor = search( dn, "(objectClass=*)", SearchScope.OBJECT,
attributes );
-            if( cursor.next() )
+            
+            // Read the response
+            if ( cursor.next() )
             {
                 resp = cursor.get();
             }
             
+            // Pass through the SaerchResultDone, or stop
+            // if we have other responses
+            cursor.next();
+            
+            // And close the cursor
             cursor.close();
         }
         catch( Exception e )

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java?rev=940480&r1=940479&r2=940480&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/SearchCursor.java
Mon May  3 15:10:59 2010
@@ -66,14 +66,14 @@ public class SearchCursor extends Abstra
 
     public boolean next() throws Exception
     {
-        if( done )
+        if ( done )
         {
             return false;
         }
         
         try
         {
-            if( future.isCancelled() )
+            if ( future.isCancelled() )
             {
                 response = null;
                 done = true;
@@ -150,7 +150,7 @@ public class SearchCursor extends Abstra
     @Override
     public void close( Exception cause ) throws Exception
     {
-        if( done )
+        if ( done )
         {
             super.close();
             return;

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/DefaultClosureMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/DefaultClosureMonitor.java?rev=940480&r1=940479&r2=940480&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/DefaultClosureMonitor.java
(original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/DefaultClosureMonitor.java
Mon May  3 15:10:59 2010
@@ -53,7 +53,7 @@ public class DefaultClosureMonitor imple
             // not going to sync because who cares if it takes a little longer 
             // to stop but we need to set cause before toggling closed state 
             // or else check for closure can throw null cause 
-            cause = new CursorClosedException();
+            cause = null;
             closed = true;
         }
     }



Mime
View raw message