directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r463149 - in /directory: branches/mina/1.0/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
Date Thu, 12 Oct 2006 08:03:54 GMT
Author: trustin
Date: Thu Oct 12 01:03:49 2006
New Revision: 463149

URL: http://svn.apache.org/viewvc?view=rev&rev=463149
Log:
Resolved issue: DIRMINA-279 (CompressionFilter returns error -5 (Z_BUF_ERROR) from jzlib in
MINA 1.0 but not in MINA 0.9.4)
* Modified AbstractIoFilterChain to bypass next filters if a write request contains an empty
buffer (a special message)


Modified:
    directory/branches/mina/1.0/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java

Modified: directory/branches/mina/1.0/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.0/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java?view=diff&rev=463149&r1=463148&r2=463149
==============================================================================
--- directory/branches/mina/1.0/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
(original)
+++ directory/branches/mina/1.0/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
Thu Oct 12 01:03:49 2006
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoFilter;
 import org.apache.mina.common.IoFilterAdapter;
@@ -786,6 +787,18 @@
                 public void filterWrite( IoSession session, WriteRequest writeRequest )
                 {
                     Entry nextEntry = EntryImpl.this.prevEntry;
+                    if( nextEntry != head && writeRequest.getMessage() instanceof
ByteBuffer )
+                    {
+                        // A special message is a buffer with zero length.
+                        // A special message will bypass all next filters.
+                        // TODO: Provide a nicer way to take care of special messages.
+                        ByteBuffer message = ( ByteBuffer ) writeRequest.getMessage();
+                        if( message.remaining() == 0 )
+                        {
+                            callPreviousFilterWrite( head.nextEntry, session, writeRequest
);
+                            return;
+                        }
+                    }
                     callPreviousFilterWrite( nextEntry, session, writeRequest );
                 }
 

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java?view=diff&rev=463149&r1=463148&r2=463149
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
Thu Oct 12 01:03:49 2006
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.common.IoFilter;
 import org.apache.mina.common.IoFilterAdapter;
@@ -786,6 +787,18 @@
                 public void filterWrite( IoSession session, WriteRequest writeRequest )
                 {
                     Entry nextEntry = EntryImpl.this.prevEntry;
+                    if( nextEntry != head && writeRequest.getMessage() instanceof
ByteBuffer )
+                    {
+                        // A special message is a buffer with zero length.
+                        // A special message will bypass all next filters.
+                        // TODO: Provide a nicer way to take care of special messages.
+                        ByteBuffer message = ( ByteBuffer ) writeRequest.getMessage();
+                        if( message.remaining() == 0 )
+                        {
+                            callPreviousFilterWrite( head.nextEntry, session, writeRequest
);
+                            return;
+                        }
+                    }
                     callPreviousFilterWrite( nextEntry, session, writeRequest );
                 }
 



Mime
View raw message