Author: fhanik Date: Thu Mar 1 23:05:51 2012 New Revision: 1295978 URL: http://svn.apache.org/viewvc?rev=1295978&view=rev Log: Fix WebSocket's non blocking call http://tomcat.markmail.org/thread/drj7zgq2csfdnvoh#query:+page:1+mid:y4dheqpm2wx5xzba+state:results
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1295978&r1=1295977&r2=1295978&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Thu Mar 1 23:05:51 2012 @@ -296,12 +296,7 @@ public class Http11NioProtocol extends A protected void upgradePoll(SocketWrapper<NioChannel> socket, Processor<NioChannel> processor) { connections.put(socket.getSocket(), processor); - - SelectionKey key = socket.getSocket().getIOChannel().keyFor( - socket.getSocket().getPoller().getSelector()); - key.interestOps(SelectionKey.OP_READ); - ((KeyAttachment) socket).interestOps( - SelectionKey.OP_READ); + socket.getSocket().getPoller().add(socket.getSocket()); } } } Modified: tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java?rev=1295978&r1=1295977&r2=1295978&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java Thu Mar 1 23:05:51 2012 @@ -104,12 +104,10 @@ public class UpgradeNioProcessor extends @Override public int read(boolean block, byte[] bytes, int off, int len) throws IOException { - // TODO Implement non-blocking reads. Should be as simple as replacing - // true with block in the two lines below if (len > maxRead) { - return readSocket(true, bytes, off, maxRead); + return readSocket(block, bytes, off, maxRead); } else { - return readSocket(true, bytes, off, len); + return readSocket(block, bytes, off, len); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org