Author: remm
Date: Tue Sep 22 08:39:44 2015
New Revision: 1704482
URL: http://svn.apache.org/viewvc?rev=1704482&view=rev
Log:
Port additional improvement for 57799, to 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/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java?rev=1704482&r1=1704481&r2=1704482&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java Tue
Sep 22 08:39:44 2015
@@ -51,8 +51,6 @@ public class NioChannel implements ByteC
protected Poller poller;
- protected volatile boolean sendFile = false;
-
public NioChannel(SocketChannel channel, ApplicationBufferHandler
bufHandler) throws IOException {
this.sc = channel;
this.bufHandler = bufHandler;
@@ -61,7 +59,6 @@ public class NioChannel implements ByteC
public void reset() throws IOException {
bufHandler.getReadBuffer().clear();
bufHandler.getWriteBuffer().clear();
- this.sendFile = false;
}
public int getBufferSize() {
@@ -219,15 +216,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/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1704482&r1=1704481&r2=1704482&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Tue
Sep 22 08:39:44 2015
@@ -1353,7 +1353,6 @@ public class NioEndpoint extends Abstrac
//configure output channel
sc = attachment.getChannel();
- sc.setSendFile(true);
//ssl channel is slightly different
WritableByteChannel wc = ((sc instanceof
SecureNioChannel)?sc:sc.getIOChannel());
@@ -1420,8 +1419,6 @@ public class NioEndpoint extends Abstrac
log.error("",t);
cancelledKey(sk, SocketStatus.ERROR, false);
return false;
- }finally {
- if (sc!=null) sc.setSendFile(false);
}
return true;
}
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=1704482&r1=1704481&r2=1704482&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
Tue Sep 22 08:39:44 2015
@@ -494,8 +494,6 @@ public class SecureNioChannel extends Ni
int written = sc.write(src);
return written;
} else {
- //make sure we can handle expand, and that we only use on buffer
- if ( (!this.isSendFile()) && (src != bufHandler.getWriteBuffer())
) throw new IllegalArgumentException("You can only write using the application
write buffer provided by the handler.");
//are we closing or closed?
if ( closing || closed) throw new IOException("Channel is in
closing state.");
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1704482&r1=1704481&r2=1704482&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Sep 22 08:39:44 2015
@@ -127,6 +127,9 @@
connections by treating this as <code>EAGAIN</code>. The same fix has
now been applied to the standard HTTP connector. (markt)
</fix>
+ <fix>
+ <bug>57799</bug>: Remove useless sendfile check for NIO SSL. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]