directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r156608 - in incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol: codec/Asn1CodecEncoder.java io/IoAdapter.java
Date Wed, 09 Mar 2005 04:19:48 GMT
Author: trustin
Date: Tue Mar  8 20:19:46 2005
New Revision: 156608

URL: http://svn.apache.org/viewcvs?view=rev&rev=156608
Log:
Fixed: Asn1CodecEncoder doesn't merge when ASN1 codec generates a collection of ByteBuffers.
(DIR-108)
Fixed: IoAdpater's default ProtocolEncoderOutput.mergeAll() doesn't check the number of the
cumulated bytebuffers

Modified:
    incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/codec/Asn1CodecEncoder.java
    incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java

Modified: incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/codec/Asn1CodecEncoder.java
URL: http://svn.apache.org/viewcvs/incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/codec/Asn1CodecEncoder.java?view=diff&r1=156607&r2=156608
==============================================================================
--- incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/codec/Asn1CodecEncoder.java
(original)
+++ incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/codec/Asn1CodecEncoder.java
Tue Mar  8 20:19:46 2005
@@ -71,6 +71,8 @@
                 {
                     this.encodeOccurred( codec, bufArray[ i ] );
                 }
+
+                encOut.mergeAll();
             }
             else if( encoded instanceof Iterator )
             {
@@ -79,6 +81,8 @@
                 {
                     this.encodeOccurred( codec, it.next() );
                 }
+                
+                encOut.mergeAll();
             }
             else if( encoded instanceof Collection )
             {
@@ -87,6 +91,8 @@
                 {
                     this.encodeOccurred( codec, it.next() );
                 }
+                
+                encOut.mergeAll();
             }
             else if( encoded instanceof Enumeration )
             {
@@ -95,6 +101,8 @@
                 {
                     this.encodeOccurred( codec, e.nextElement() );
                 }
+                
+                encOut.mergeAll();
             }
             else
             {

Modified: incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java?view=diff&r1=156607&r2=156608
==============================================================================
--- incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java
(original)
+++ incubator/directory/network/mina/trunk/src/java/org/apache/mina/protocol/io/IoAdapter.java
Tue Mar  8 20:19:46 2005
@@ -429,6 +429,12 @@
             int sum = 0;
             final int size = queue.size();
             
+            if( size < 2 )
+            {
+                // no need to merge!
+                return;
+            }
+            
             // Get the size of merged BB
             for( int i = size - 1; i >= 0; i -- )
             {



Mime
View raw message