directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r179046 - in /directory/network: branches/0.7/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java trunk/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
Date Mon, 30 May 2005 11:14:50 GMT
Author: trustin
Date: Mon May 30 04:14:48 2005
New Revision: 179046

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


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

Modified: directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java?rev=179046&r1=179045&r2=179046&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
(original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/protocol/codec/DemuxingProtocolCodecFactory.java
Mon May 30 04:14:48 2005
@@ -227,10 +227,18 @@
                 {
                     MessageDecoder decoder = decoders[i];
                     int limit = in.limit();
-                    in.position( 0 );
-                    MessageDecoderResult result = decoder.decodable( session, in );
-                    in.position( 0 );
-                    in.limit( limit );
+                    int pos = in.position();
+
+                    MessageDecoderResult result;
+                    try
+                    {
+                        result = decoder.decodable( session, in );
+                    }
+                    finally
+                    {
+                        in.position( pos );
+                        in.limit( limit );
+                    }
                     
                     if( result == MessageDecoder.OK )
                     {

Modified: directory/network/trunk/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java?rev=179046&r1=179045&r2=179046&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/codec/DemuxingProtocolCodecFactory.java
Mon May 30 04:14:48 2005
@@ -212,7 +212,7 @@
         }
 
         protected boolean doDecode( IoSession session, ByteBuffer in,
-                                    ProtocolDecoderOutput out) throws ProtocolViolationException
+                                    ProtocolDecoderOutput out ) throws ProtocolViolationException
         {
             if( currentDecoder == null )
             {
@@ -222,10 +222,18 @@
                 {
                     MessageDecoder decoder = decoders[i];
                     int limit = in.limit();
-                    in.position( 0 );
-                    MessageDecoderResult result = decoder.decodable( session, in );
-                    in.position( 0 );
-                    in.limit( limit );
+                    int pos = in.position();
+
+                    MessageDecoderResult result;
+                    try
+                    {
+                        result = decoder.decodable( session, in );
+                    }
+                    finally
+                    {
+                        in.position( pos );
+                        in.limit( limit );
+                    }
                     
                     if( result == MessageDecoder.OK )
                     {



Mime
View raw message