directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r414011 - in /directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support: SearchHandler.java SearchResponseIterator.java
Date Wed, 14 Jun 2006 00:39:11 GMT
Author: akarasulu
Date: Tue Jun 13 17:39:10 2006
New Revision: 414011

URL: http://svn.apache.org/viewvc?rev=414011&view=rev
Log:
fixed DIRSERVER-644

Modified:
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java?rev=414011&r1=414010&r2=414011&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
Tue Jun 13 17:39:10 2006
@@ -223,7 +223,7 @@
                     }
                     if ( list.hasMore() )
                     {
-                        Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope()
);
+                        Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope(),
session );
                         while ( it.hasNext() )
                         {
                             Response resp = ( Response ) it.next();
@@ -276,7 +276,7 @@
 
             if ( list.hasMore() )
             {
-                Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope()
);
+                Iterator it = new SearchResponseIterator( req, ctx, list, controls.getSearchScope(),
session );
                 while ( it.hasNext() )
                 {
                     session.write( it.next() );

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java?rev=414011&r1=414010&r2=414011&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
Tue Jun 13 17:39:10 2006
@@ -27,6 +27,7 @@
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.jndi.ServerLdapContext;
+import org.apache.directory.server.ldap.SessionRegistry;
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -41,6 +42,7 @@
 import org.apache.directory.shared.ldap.message.SearchResponseReferenceImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
+import org.apache.mina.common.IoSession;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -59,6 +61,7 @@
     private final SearchRequest req;
     private final ServerLdapContext ctx;
     private final NamingEnumeration underlying;
+    private final IoSession session;
     private SearchResponseDone respDone;
     private boolean done = false;
     private Object prefetched;
@@ -72,12 +75,14 @@
      * @param req the search request to generate responses to
      * @param underlying the underlying JNDI enumeration containing SearchResults
      */
-    public SearchResponseIterator(SearchRequest req, ServerLdapContext ctx, NamingEnumeration
underlying, int scope)
+    public SearchResponseIterator( SearchRequest req, ServerLdapContext ctx, NamingEnumeration
underlying, int scope,
+        IoSession session )
     {
         this.req = req;
         this.ctx = ctx;
         this.scope = scope;
         this.underlying = underlying;
+        this.session = session;
 
         try
         {
@@ -141,6 +146,10 @@
                     prefetched = respRef;
                 }
             }
+            else
+            {
+                SessionRegistry.getSingleton().removeOutstandingRequest( session, req.getMessageId()
);
+            }
         }
         catch ( NamingException e )
         {
@@ -208,6 +217,7 @@
                 respDone = ( SearchResponseDone ) req.getResultResponse();
                 respDone.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
                 prefetched = null;
+                SessionRegistry.getSingleton().removeOutstandingRequest( session, req.getMessageId()
);
                 return next;
             }
         }
@@ -421,6 +431,7 @@
             }
         }
         
+        SessionRegistry.getSingleton().removeOutstandingRequest( session, req.getMessageId()
);
         return resp;
     }
 }



Mime
View raw message