directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r365714 - /directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/TwixDecoder.java
Date Tue, 03 Jan 2006 19:02:29 GMT
Author: elecharny
Date: Tue Jan  3 11:02:18 2006
New Revision: 365714

URL: http://svn.apache.org/viewcvs?rev=365714&view=rev
Log:
Fixed a case where byte[] contains more than one PDU

Modified:
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/TwixDecoder.java

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/TwixDecoder.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/TwixDecoder.java?rev=365714&r1=365713&r2=365714&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/TwixDecoder.java
(original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/asn1/TwixDecoder.java
Tue Jan  3 11:02:18 2006
@@ -95,18 +95,21 @@
     		}
     	}
     	
-       	ldapDecoder.decode( buf, ldapMessageContainer );
-       	
-       	if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
-       	{
-       		if ( log.isDebugEnabled() )
-       		{
-       			log.debug( "Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
-       		}
-       		
-       		decoderCallback.decodeOccurred( null, ldapMessageContainer.getLdapMessage() );
-       		ldapMessageContainer.clean();
-       	}
+    	while ( buf.hasRemaining() )
+    	{
+	       	ldapDecoder.decode( buf, ldapMessageContainer );
+	       	
+	       	if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+	       	{
+	       		if ( log.isDebugEnabled() )
+	       		{
+	       			log.debug( "Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
+	       		}
+	       		
+	       		decoderCallback.decodeOccurred( null, ldapMessageContainer.getLdapMessage() );
+	       		ldapMessageContainer.clean();
+	       	}
+    	}
     }
     
     /**



Mime
View raw message