directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r177928 - in /directory/network: branches/0.7/src/java/org/apache/mina/protocol/codec/CumulativeProtocolDecoder.java trunk/src/java/org/apache/mina/filter/codec/CumulativeProtocolDecoder.java
Date Mon, 23 May 2005 06:00:30 GMT
Author: trustin
Date: Sun May 22 23:00:29 2005
New Revision: 177928

URL: http://svn.apache.org/viewcvs?rev=177928&view=rev
Log:
Fixed: DIRMINA-45


Modified:
    directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/CumulativeProtocolDecoder.java
    directory/network/trunk/src/java/org/apache/mina/filter/codec/CumulativeProtocolDecoder.java

Modified: directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/CumulativeProtocolDecoder.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/CumulativeProtocolDecoder.java?rev=177928&r1=177927&r2=177928&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/CumulativeProtocolDecoder.java
(original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/CumulativeProtocolDecoder.java
Sun May 22 23:00:29 2005
@@ -101,15 +101,23 @@
             for( ;; )
             {
                 int oldPos = buf.position();
-                if( !doDecode( session, buf, out ) )
+                boolean decoded = doDecode( session, buf, out );
+                if( decoded )
                 {
-                    break;
+                    if( buf.position() == oldPos )
+                    {
+                        throw new IllegalStateException(
+                                "doDecode() can't return true when buffer is not consumed."
);
+                    }
+                    
+                    if( !buf.hasRemaining() )
+                    {
+                        break;
+                    }
                 }
-                
-                if( buf.position() == oldPos )
+                else
                 {
-                    throw new IllegalStateException(
-                            "doDecode() can't return true when buffer is not consumed." );
+                    break;
                 }
             }
         }

Modified: directory/network/trunk/src/java/org/apache/mina/filter/codec/CumulativeProtocolDecoder.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/codec/CumulativeProtocolDecoder.java?rev=177928&r1=177927&r2=177928&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/codec/CumulativeProtocolDecoder.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/codec/CumulativeProtocolDecoder.java
Sun May 22 23:00:29 2005
@@ -98,15 +98,23 @@
             for( ;; )
             {
                 int oldPos = buf.position();
-                if( !doDecode( session, buf, out ) )
+                boolean decoded = doDecode( session, buf, out );
+                if( decoded )
                 {
-                    break;
+                    if( buf.position() == oldPos )
+                    {
+                        throw new IllegalStateException(
+                                "doDecode() can't return true when buffer is not consumed."
);
+                    }
+                    
+                    if( !buf.hasRemaining() )
+                    {
+                        break;
+                    }
                 }
-                
-                if( buf.position() == oldPos )
+                else
                 {
-                    throw new IllegalStateException(
-                            "doDecode() can't return true when buffer is not consumed." );
+                    break;
                 }
             }
         }



Mime
View raw message