Author: remm
Date: Tue Sep 22 08:29:17 2015
New Revision: 1704477

URL: http://svn.apache.org/viewvc?rev=1704477&view=rev
Log:
As part of 57799, also remove the sendfile flag. It is used to ensure expand 
capability on the buffer, but expand can only happen in rare cases during 
handshake so the check is not useful.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java?rev=1704477&r1=1704476&r2=1704477&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java Tue Sep 22 
08:29:17 2015
@@ -48,8 +48,6 @@ public class NioChannel implements ByteC
 
     protected Poller poller;
 
-    protected volatile boolean sendFile = false;
-
     public NioChannel(SocketChannel channel, SocketBufferHandler bufHandler) {
         this.sc = channel;
         this.bufHandler = bufHandler;
@@ -62,7 +60,6 @@ public class NioChannel implements ByteC
      */
     public void reset() throws IOException {
         bufHandler.reset();
-        this.sendFile = false;
     }
 
 
@@ -217,15 +214,6 @@ public class NioChannel implements ByteC
         return false;
     }
 
-    public boolean isSendFile() {
-        return sendFile;
-    }
-
-    public void setSendFile(boolean s) {
-        this.sendFile = s;
-    }
-
-
     /**
      * This method should be used to check the interrupt status before
      * attempting a write.

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1704477&r1=1704476&r2=1704477&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Tue Sep 22 
08:29:17 2015
@@ -958,9 +958,6 @@ public class NioEndpoint extends Abstrac
 
                 // Configure output channel
                 sc = socketWrapper.getSocket();
-                if (calledByProcessor) {
-                    sc.setSendFile(true);
-                }
                 // TLS/SSL channel is slightly different
                 WritableByteChannel wc = ((sc instanceof 
SecureNioChannel)?sc:sc.getIOChannel());
 
@@ -989,7 +986,6 @@ public class NioEndpoint extends Abstrac
                         log.debug("Send file complete for: "+sd.fileName);
                     }
                     socketWrapper.setSendfileData(null);
-                    sc.setSendFile(false);
                     try {
                         sd.fchannel.close();
                     } catch (Exception ignore) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=1704477&r1=1704476&r2=1704477&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java Tue Sep 
22 08:29:17 2015
@@ -588,11 +588,6 @@ public class SecureNioChannel extends Ni
                 throw new IOException(sm.getString("channel.nio.ssl.closing"));
             }
 
-            // Make sure we can handle expand, and that we only use one buffer
-            if (!this.isSendFile() && src != bufHandler.getWriteBuffer()) {
-                throw new 
IllegalArgumentException(sm.getString("channel.nio.ssl.invalidBuffer"));
-            }
-
             if (!flush(netOutBuffer)) {
                 // We haven't emptied out the buffer yet
                 return 0;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to