directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r290638 - /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java
Date Wed, 21 Sep 2005 07:15:27 GMT
Author: elecharny
Date: Wed Sep 21 00:15:21 2005
New Revision: 290638

URL: http://svn.apache.org/viewcvs?rev=290638&view=rev
Log:
Modified the Controls generation, which was buggy.

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java?rev=290638&r1=290637&r2=290638&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java
Wed Sep 21 00:15:21 2005
@@ -459,19 +459,16 @@
         if (controls != null)
         {
             // Controls :
-            // 0x90 L3
+            // 0xA0 L3
             //  |
             //  +--> 0x30 L4
-            //        |
-            //        +--> 0x30 L5
-            //        +--> 0x30 L6
-            //        +--> ...
-            //        +--> 0x30 Li
-            //        +--> ...
-            //        +--> 0x30 Ln
+            //  +--> 0x30 L5
+            //  +--> ...
+            //  +--> 0x30 Li
+            //  +--> ...
+            //  +--> 0x30 Ln
             //
-            // L3 = Length(0x30) + Length(L4) + L4
-            // L4 = Length(0x30) + Length(L5) + L5
+            // L3 = Length(0x30) + Length(L5) + L5
             //      + Length(0x30) + Length(L6) + L6
             //      + ...
             //      + Length(0x30) + Length(Li) + Li
@@ -491,10 +488,10 @@
             }
             
             // Computes the controls length
-            controlsLength = 1 + Length.getNbBytes( controlsSequenceLength ) + controlsSequenceLength;

+            controlsLength = controlsSequenceLength; //1 + Length.getNbBytes( controlsSequenceLength
) + controlsSequenceLength; 
                 
             // Now, add the tag and the length of the controls length
-            ldapMessageLength += 1 + Length.getNbBytes( controlsLength ) + controlsLength;
+            ldapMessageLength += 1 + Length.getNbBytes( controlsSequenceLength ) + controlsSequenceLength;
         }
         
         // finally, calculate the global message size :
@@ -559,8 +556,8 @@
             bb.put( Length.getBytes( controlsLength ) );
 
             // Encode the control's sequence
-            bb.put( UniversalTag.SEQUENCE_TAG );
-            bb.put( Length.getBytes( controlsSequenceLength ) );
+            //bb.put( UniversalTag.SEQUENCE_TAG );
+            //bb.put( Length.getBytes( controlsSequenceLength ) );
 
             // Encode each control
             Iterator controlIterator = controls.iterator();



Mime
View raw message