tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1237995 - in /tomcat/trunk/java/org/apache: coyote/ajp/ coyote/http11/ tomcat/util/ tomcat/util/net/
Date Mon, 30 Jan 2012 20:46:12 GMT
Author: markt
Date: Mon Jan 30 20:46:11 2012
New Revision: 1237995

URL: http://svn.apache.org/viewvc?rev=1237995&view=rev
Log:
Remove MutableInteger that was unused since r1086203 removed the once
place where it was read.

Removed:
    tomcat/trunk/java/org/apache/tomcat/util/MutableInteger.java
Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1237995&r1=1237994&r2=1237995&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Mon Jan 30 20:46:11 2012
@@ -292,8 +292,7 @@ public class AjpNioProcessor extends Abs
             //ignore
         }
         try {
-            pool.write(writeBuffer, socket, selector, writeTimeout, true,
-                    null);
+            pool.write(writeBuffer, socket, selector, writeTimeout, true);
         }finally {
             if ( selector != null ) pool.put(selector);
         }

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java?rev=1237995&r1=1237994&r2=1237995&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Mon Jan 30 20:46:11
2012
@@ -24,7 +24,6 @@ import java.nio.channels.Selector;
 
 import org.apache.coyote.OutputBuffer;
 import org.apache.coyote.Response;
-import org.apache.tomcat.util.MutableInteger;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.http.HttpMessages;
 import org.apache.tomcat.util.net.AbstractEndpoint;
@@ -68,11 +67,6 @@ public class InternalNioOutputBuffer ext
 
 
     /**
-     * Number of bytes last written
-     */
-    private MutableInteger lastWrite = new MutableInteger(1);
-
-    /**
      * Underlying socket.
      */
     private NioChannel socket;
@@ -113,7 +107,6 @@ public class InternalNioOutputBuffer ext
             socket.getBufHandler().getWriteBuffer().clear();
             socket = null;
         }
-        lastWrite.set(1);
     }
 
 
@@ -167,10 +160,10 @@ public class InternalNioOutputBuffer ext
             //ignore
         }
         try {
-            written = pool.write(bytebuffer, socket, selector, writeTimeout, block,lastWrite);
+            written = pool.write(bytebuffer, socket, selector, writeTimeout, block);
             //make sure we are flushed
             do {
-                if (socket.flush(true,selector,writeTimeout,lastWrite)) break;
+                if (socket.flush(true,selector,writeTimeout)) break;
             }while ( true );
         }finally {
             if ( selector != null ) pool.put(selector);

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1237995&r1=1237994&r2=1237995&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Mon Jan 30 20:46:11
2012
@@ -34,7 +34,6 @@ import java.util.concurrent.atomic.Atomi
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
-import org.apache.tomcat.util.MutableInteger;
 import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
 
 public class NioBlockingSelector {
@@ -79,7 +78,8 @@ public class NioBlockingSelector {
      * @throws SocketTimeoutException if the write times out
      * @throws IOException if an IO Exception occurs in the underlying socket logic
      */
-    public int write(ByteBuffer buf, NioChannel socket, long writeTimeout,MutableInteger
lastWrite) throws IOException {
+    public int write(ByteBuffer buf, NioChannel socket, long writeTimeout)
+            throws IOException {
         SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
         if ( key == null ) throw new IOException("Key no longer registered");
         KeyReference reference = new KeyReference();
@@ -92,7 +92,6 @@ public class NioBlockingSelector {
             while ( (!timedout) && buf.hasRemaining()) {
                 if (keycount > 0) { //only write if we were registered for a write
                     int cnt = socket.write(buf); //write the data
-                    if (lastWrite != null) lastWrite.set(cnt);
                     if (cnt == -1)
                         throw new EOFException();
                     written += cnt;

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=1237995&r1=1237994&r2=1237995&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java Mon Jan 30 20:46:11 2012
@@ -23,7 +23,6 @@ import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.nio.channels.SocketChannel;
 
-import org.apache.tomcat.util.MutableInteger;
 import org.apache.tomcat.util.net.NioEndpoint.Poller;
 import org.apache.tomcat.util.net.SecureNioChannel.ApplicationBufferHandler;
 
@@ -78,14 +77,12 @@ public class NioChannel implements ByteC
      * @param block     Unused. May be used when overridden
      * @param s         Unused. May be used when overridden
      * @param timeout   Unused. May be used when overridden
-     * @param lastWrite
      * @return Always returns <code>true</code> since there is no network buffer
      *         in the regular channel
      * @throws IOException
      */
-    public boolean flush(boolean block, Selector s, long timeout,
-            MutableInteger lastWrite) throws IOException {
-        if (lastWrite!=null) lastWrite.set(1);
+    public boolean flush(boolean block, Selector s, long timeout)
+            throws IOException {
         return true;
     }
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java?rev=1237995&r1=1237994&r2=1237995&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioSelectorPool.java Mon Jan 30 20:46:11
2012
@@ -28,7 +28,6 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
-import org.apache.tomcat.util.MutableInteger;
 
 /**
  *
@@ -166,13 +165,13 @@ public class NioSelectorPool {
      * @throws IOException if an IO Exception occurs in the underlying socket logic
      */
     public int write(ByteBuffer buf, NioChannel socket, Selector selector, long writeTimeout)
throws IOException {
-        return write(buf,socket,selector,writeTimeout,true,null);
+        return write(buf,socket,selector,writeTimeout,true);
     }
 
     public int write(ByteBuffer buf, NioChannel socket, Selector selector,
-                     long writeTimeout, boolean block,MutableInteger lastWrite) throws IOException
{
+                     long writeTimeout, boolean block) throws IOException {
         if ( SHARED && block ) {
-            return blockingSelector.write(buf,socket,writeTimeout,lastWrite);
+            return blockingSelector.write(buf,socket,writeTimeout);
         }
         SelectionKey key = null;
         int written = 0;
@@ -184,7 +183,6 @@ public class NioSelectorPool {
                 int cnt = 0;
                 if ( keycount > 0 ) { //only write if we were registered for a write
                     cnt = socket.write(buf); //write the data
-                    if (lastWrite!=null) lastWrite.set(cnt);
                     if (cnt == -1) throw new EOFException();
 
                     written += cnt;

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=1237995&r1=1237994&r2=1237995&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java Mon Jan 30 20:46:11
2012
@@ -29,8 +29,6 @@ import javax.net.ssl.SSLEngineResult;
 import javax.net.ssl.SSLEngineResult.HandshakeStatus;
 import javax.net.ssl.SSLEngineResult.Status;
 
-import org.apache.tomcat.util.MutableInteger;
-
 /**
  *
  * Implementation of a secure socket channel
@@ -110,18 +108,17 @@ public class SecureNioChannel extends Ni
      * @param block     Should a blocking write be used?
      * @param s
      * @param timeout
-     * @param lastWrite
      * @return <code>true</code> if the network buffer has been flushed out and
      *         is empty else <code>false</code>
      * @throws IOException
      */
     @Override
-    public boolean flush(boolean block, Selector s, long timeout,
-            MutableInteger lastWrite) throws IOException {
+    public boolean flush(boolean block, Selector s, long timeout)
+            throws IOException {
         if (!block) {
             flush(netOutBuffer);
         } else {
-            pool.write(netOutBuffer, this, s, timeout,block,lastWrite);
+            pool.write(netOutBuffer, this, s, timeout,block);
         }
         return !netOutBuffer.hasRemaining();
     }



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


Mime
View raw message