You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/04/23 23:11:20 UTC
svn commit: r1589521 - in /tomcat/trunk:
java/org/apache/coyote/http11/Http11NioProcessor.java
webapps/docs/changelog.xml
Author: markt
Date: Wed Apr 23 21:11:20 2014
New Revision: 1589521
URL: http://svn.apache.org/r1589521
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56348
Fix slow async reads on non-container thread.
Align code with APR.
Ensure that selector is woken up when a socket is registered for a new event
Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1589521&r1=1589520&r2=1589521&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Apr 23 21:11:20 2014
@@ -155,20 +155,15 @@ public class Http11NioProcessor extends
@Override
protected void registerForEvent(boolean read, boolean write) {
final NioChannel socket = socketWrapper.getSocket();
- final NioEndpoint.KeyAttachment attach =
- (NioEndpoint.KeyAttachment) socket.getAttachment(false);
- if (attach == null) {
- return;
- }
- SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
+
+ int interestOps = 0;
if (read) {
- attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
- key.interestOps(key.interestOps() | SelectionKey.OP_READ);
+ interestOps = SelectionKey.OP_READ;
}
if (write) {
- attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
- key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
+ interestOps = interestOps | SelectionKey.OP_WRITE;
}
+ socket.getPoller().add(socket, interestOps);
}
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1589521&r1=1589520&r2=1589521&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Apr 23 21:11:20 2014
@@ -149,6 +149,10 @@
<scode>
Fix code duplication between NIO and NIO2. (remm)
</scode>
+ <fix>
+ <bug>56348</bug>: Fix slow asynchronous read when read was performed on
+ a non-container thread. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org