mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Cadien (JIRA)" <j...@apache.org>
Subject [jira] Created: (DIRMINA-524) ProtocolCodecFilter should pass FileRegion to nextFilter in addition to IoBuffer
Date Fri, 01 Feb 2008 21:19:08 GMT
ProtocolCodecFilter should pass FileRegion to nextFilter in addition to IoBuffer
--------------------------------------------------------------------------------

                 Key: DIRMINA-524
                 URL: https://issues.apache.org/jira/browse/DIRMINA-524
             Project: MINA
          Issue Type: Bug
          Components: Filter
         Environment: jdk1.6.0_03 Linux x64
            Reporter: Geoff Cadien
             Fix For: 2.0.0-M1


ProtocolCodecFilter.filterWrite calls nextFilter.filterWrite directly without invoking the
ProtocolEncoder if the WriteRequest message is an IoBuffer.  It should do the same if the
message is a FileRegion.

Here is a quick patch:



Index: ProtocolCodecFilter.java
===================================================================
--- ProtocolCodecFilter.java    (revision 617648)
+++ ProtocolCodecFilter.java    (working copy)
@@ -25,6 +25,7 @@
 import org.apache.mina.common.AttributeKey;
 import org.apache.mina.common.DefaultWriteFuture;
 import org.apache.mina.common.DefaultWriteRequest;
+import org.apache.mina.common.FileRegion;
 import org.apache.mina.common.IoBuffer;
 import org.apache.mina.common.IoFilter;
 import org.apache.mina.common.IoFilterAdapter;
@@ -222,7 +223,7 @@
     public void filterWrite(NextFilter nextFilter, IoSession session,
             WriteRequest writeRequest) throws Exception {
         Object message = writeRequest.getMessage();
-        if (message instanceof IoBuffer) {
+        if (message instanceof IoBuffer || message instanceof FileRegion) {
             nextFilter.filterWrite(session, writeRequest);
             return;
         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message