directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r426919 - /directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
Date Sun, 30 Jul 2006 19:22:16 GMT
Author: elecharny
Date: Sun Jul 30 12:22:15 2006
New Revision: 426919

URL: http://svn.apache.org/viewvc?rev=426919&view=rev
Log:
Fixed DIRSERVER_623 (time limit was internally seen as ms, not seconds)

Modified:
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.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=426919&r1=426918&r2=426919&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
Sun Jul 30 12:22:15 2006
@@ -87,7 +87,20 @@
         if ( isAdmin )
         {
             controls.setCountLimit( req.getSizeLimit() );
-            controls.setTimeLimit( req.getTimeLimit() );
+            
+            // The setTimeLimit needs a number of milliseconds
+            // when the search control is expressed in seconds
+            int timeLimit = req.getTimeLimit();
+            
+            // Just check that we are not exceeding the maximum for a long 
+            if ( timeLimit > Integer.MAX_VALUE / 1000 )
+            {
+                timeLimit = 0;
+            }
+            
+            // The maximum time we can wait is around 24 days ...
+            // Is it enough ? ;)
+            controls.setTimeLimit( timeLimit * 1000 );
         }
         else
         {



Mime
View raw message