directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r290737 - in /directory/network/branches/0.7/src/java/org/apache/mina: io/AbstractIoFilterChain.java protocol/io/IoAdapter.java
Date Wed, 21 Sep 2005 16:31:16 GMT
Author: trustin
Date: Wed Sep 21 09:31:11 2005
New Revision: 290737

URL: http://svn.apache.org/viewcvs?rev=290737&view=rev
Log:
Fix for DIRMINA-91 - BufferUnderflowException while calling ProtocolViolationException.getMessage()
* Fixed that the ByteBuffer which is set to ProtocolViolationException is released too early.
* Fixed ByteBuffer is not released when an exception is thrown in dataRead event handler method


Modified:
    directory/network/branches/0.7/src/java/org/apache/mina/io/AbstractIoFilterChain.java
    directory/network/branches/0.7/src/java/org/apache/mina/protocol/io/IoAdapter.java

Modified: directory/network/branches/0.7/src/java/org/apache/mina/io/AbstractIoFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/io/AbstractIoFilterChain.java?rev=290737&r1=290736&r2=290737&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/io/AbstractIoFilterChain.java
(original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/io/AbstractIoFilterChain.java
Wed Sep 21 09:31:11 2005
@@ -147,8 +147,14 @@
                                  ByteBuffer buf ) throws Exception
             {
                 IoHandler handler = session.getHandler();
-                handler.dataRead( session, buf );
-                buf.release();
+                try
+                {
+                    handler.dataRead( session, buf );
+                }
+                finally
+                {
+                    buf.release();
+                }
             }
 
             public void dataWritten( NextFilter nextFilter, IoSession session,

Modified: directory/network/branches/0.7/src/java/org/apache/mina/protocol/io/IoAdapter.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.7/src/java/org/apache/mina/protocol/io/IoAdapter.java?rev=290737&r1=290736&r2=290737&view=diff
==============================================================================
--- directory/network/branches/0.7/src/java/org/apache/mina/protocol/io/IoAdapter.java (original)
+++ directory/network/branches/0.7/src/java/org/apache/mina/protocol/io/IoAdapter.java Wed
Sep 21 09:31:11 2005
@@ -151,6 +151,7 @@
             }
             catch( ProtocolViolationException pve )
             {
+                in.acquire();  // Prevent the buffer from being released.
                 pve.setBuffer( in );
                 managerFilterChain.exceptionCaught( psession, pve );
             }



Mime
View raw message