james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1161998 - in /james/server/trunk: imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java
Date Fri, 26 Aug 2011 05:35:39 GMT
Author: norman
Date: Fri Aug 26 05:35:39 2011
New Revision: 1161998

URL: http://svn.apache.org/viewvc?rev=1161998&view=rev
Log:
Zero-file-copy MAY only be used when no TLS/SSL is active. See JAMES-1305

Modified:
    james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
    james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java

Modified: james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java?rev=1161998&r1=1161997&r2=1161998&view=diff
==============================================================================
--- james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
(original)
+++ james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/ChannelImapResponseWriter.java
Fri Aug 26 05:35:39 2011
@@ -30,6 +30,7 @@ import org.jboss.netty.buffer.ChannelBuf
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.DefaultFileRegion;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import org.jboss.netty.handler.ssl.SslHandler;
 import org.jboss.netty.handler.stream.ChunkedNioFile;
 import org.jboss.netty.handler.stream.ChunkedStream;
 
@@ -67,7 +68,10 @@ public class ChannelImapResponseWriter i
         InputStream in = literal.getInputStream();
         if (in instanceof FileInputStream && channel.getFactory() instanceof NioServerSocketChannelFactory)
{
             FileChannel fc = ((FileInputStream) in).getChannel();
-            if (zeroCopy) {
+            // Zero-copy is only possible if no SSL/TLS is in place
+            //
+            // See JAMES-1305
+            if (zeroCopy && channel.getPipeline().get(SslHandler.class) == null)
{
                 channel.write(new DefaultFileRegion(fc, fc.position(), literal.size()));
             } else {
                 channel.write(new ChunkedNioFile(fc, 8192));

Modified: james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java?rev=1161998&r1=1161997&r2=1161998&view=diff
==============================================================================
--- james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java
(original)
+++ james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java
Fri Aug 26 05:35:39 2011
@@ -38,6 +38,7 @@ import org.jboss.netty.channel.ChannelFu
 import org.jboss.netty.channel.ChannelHandlerContext;
 import org.jboss.netty.channel.DefaultFileRegion;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import org.jboss.netty.handler.ssl.SslHandler;
 import org.jboss.netty.handler.stream.ChunkedNioFile;
 import org.slf4j.Logger;
 
@@ -145,7 +146,10 @@ public class POP3NettySession extends Ab
         if (stream instanceof FileInputStream  && channel.getFactory() instanceof
NioServerSocketChannelFactory) {
             FileChannel fc = ((FileInputStream) stream).getChannel();
             try {
-                if (zeroCopy) {
+                // Zero-copy is only possible if no SSL/TLS is in place
+                //
+                // See JAMES-1305
+                if (zeroCopy && channel.getPipeline().get(SslHandler.class) == null)
{
                     channel.write(new DefaultFileRegion(fc, fc.position(), fc.size()));
                 } else {
                     channel.write(new ChunkedNioFile(fc, 8192));



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message