Ooops, forgot to pass in the double buffered channel to the selector pool for write...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 26 Oct 2006 20:57:28 +0000 (20:57 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 26 Oct 2006 20:57:28 +0000 (20:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@468132 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/InternalNioInputBuffer.java
java/org/apache/coyote/http11/InternalNioOutputBuffer.java
java/org/apache/tomcat/util/net/NioSelectorPool.java
java/org/apache/tomcat/util/net/SecureNioChannel.java

index 5504152..3acd07f 100644 (file)
@@ -570,7 +570,7 @@ public class InternalNioInputBuffer implements InputBuffer {
             Selector selector = null;
             try { selector = getSelectorPool().get(); }catch ( IOException x ) {}
             try {
-                nRead = getSelectorPool().read(socket.getBufHandler().getReadBuffer(),socket.getIOChannel(),selector,rto);
+                nRead = getSelectorPool().read(socket.getBufHandler().getReadBuffer(),socket,selector,rto);
             } catch ( EOFException eof ) {
                 nRead = -1;
             } finally { 
index 206880f..1525dd8 100644 (file)
@@ -431,7 +431,7 @@ public class InternalNioOutputBuffer
             //ignore
         }
         try {
-            written = getSelectorPool().write(bytebuffer, socket.getIOChannel(), selector, writeTimeout);
+            written = getSelectorPool().write(bytebuffer, socket, selector, writeTimeout);
             //make sure we are flushed 
             do {
                 if (socket.flush(selector)) break;
index d6d0325..61b4a8b 100644 (file)
@@ -99,7 +99,7 @@ public class NioSelectorPool {
      * @throws SocketTimeoutException if the write times out
      * @throws IOException if an IO Exception occurs in the underlying socket logic
      */
-    public int write(ByteBuffer buf, SocketChannel socket, Selector selector, long writeTimeout) throws IOException {
+    public int write(ByteBuffer buf, NioChannel socket, Selector selector, long writeTimeout) throws IOException {
         SelectionKey key = null;
         int written = 0;
         boolean timedout = false;
@@ -118,7 +118,7 @@ public class NioSelectorPool {
                 }
                 if ( selector != null ) {
                     //register OP_WRITE to the selector
-                    if (key==null) key = socket.register(selector, SelectionKey.OP_WRITE);
+                    if (key==null) key = socket.getIOChannel().register(selector, SelectionKey.OP_WRITE);
                     else key.interestOps(SelectionKey.OP_WRITE);
                     keycount = selector.select(writeTimeout);
                 }                
@@ -147,7 +147,7 @@ public class NioSelectorPool {
      * @throws SocketTimeoutException if the read times out
      * @throws IOException if an IO Exception occurs in the underlying socket logic
      */
-    public int read(ByteBuffer buf, SocketChannel socket, Selector selector, long readTimeout) throws IOException {
+    public int read(ByteBuffer buf, NioChannel socket, Selector selector, long readTimeout) throws IOException {
         SelectionKey key = null;
         int read = 0;
         boolean timedout = false;
@@ -163,7 +163,7 @@ public class NioSelectorPool {
                 }
                 if ( selector != null ) {
                     //register OP_WRITE to the selector
-                    if (key==null) key = socket.register(selector, SelectionKey.OP_READ);
+                    if (key==null) key = socket.getIOChannel().register(selector, SelectionKey.OP_READ);
                     else key.interestOps(SelectionKey.OP_READ);
                     keycount = selector.select(readTimeout);
                 }                
index 44da15e..d2b0efc 100644 (file)
@@ -87,7 +87,7 @@ public class SecureNioChannel extends NioChannel  {
      * @return boolean
      */
     public boolean flush(Selector s, long timeout) throws IOException {
-        pool.write(netOutBuffer,sc,s,timeout);
+        pool.write(netOutBuffer,this,s,timeout);
         return !netOutBuffer.hasRemaining();
     }