directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r726874 - in /directory: apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/
Date Mon, 15 Dec 2008 23:32:40 GMT
Author: elecharny
Date: Mon Dec 15 15:32:39 2008
New Revision: 726874

URL: http://svn.apache.org/viewvc?rev=726874&view=rev
Log:
o Allowed negative values for the paged size limit (to allow M$ faulty client to work)
o Added a test with a negative value

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlGrammar.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=726874&r1=726873&r2=726874&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
Mon Dec 15 15:32:39 2008
@@ -940,4 +940,22 @@
         
         doLoop( ctx, controls, 5, 1, 5, true );
     }
+
+    
+    /**
+     * Admin = no <br>
+     * SL = none<br>
+     * RL = none<br>
+     * PL = -2<br>
+     * expected exception : no<br>
+     * expected number of entries returned : 10 <br>
+     */
+    @Test
+    public void testSearchPagedSearchWithNegativePL() throws Exception
+    {
+        DirContext ctx = getWiredContext( ldapService, "cn=user,ou=system", "secret" );
+        SearchControls controls = createSearchControls( ctx, LdapService.NO_SIZE_LIMIT, -2
);
+        
+        doLoop( ctx, controls, -2, 1, 10, false );
+    }
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlGrammar.java?rev=726874&r1=726873&r2=726874&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlGrammar.java
Mon Dec 15 15:32:39 2008
@@ -118,7 +118,14 @@
                     try
                     {
                         // Check that the value is into the allowed interval
-                        int size = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );
+                        int size = IntegerDecoder.parse( value, Integer.MIN_VALUE, Integer.MAX_VALUE
);
+                        
+                        // We allow negative value to absorb a bug in some M$ client.
+                        // Those negative values will be transformed to Integer.MAX_VALUE.
+                        if ( size < 0 )
+                        {
+                            size = Integer.MAX_VALUE;
+                        }
                         
                         if ( IS_DEBUG )
                         {



Mime
View raw message