Author: markt
Date: Mon Oct 31 15:29:27 2016
New Revision: 1767307

URL: http://svn.apache.org/viewvc?rev=1767307&view=rev
Log:
Follow up to r1767250: rename soTimeout to connectionTimeout in ProcotolHandler 
and Endpoint

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Mon Oct 31 
15:29:27 2016
@@ -273,12 +273,10 @@ public abstract class AbstractProtocol<S
      * wait for that data to arrive before closing the connection.
      */
     public int getConnectionTimeout() {
-        // Note that the endpoint uses the alternative name
-        return endpoint.getSoTimeout();
+        return endpoint.getConnectionTimeout();
     }
     public void setConnectionTimeout(int timeout) {
-        // Note that the endpoint uses the alternative name
-        endpoint.setSoTimeout(timeout);
+        endpoint.setConnectionTimeout(timeout);
     }
 
     /*

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Mon Oct 31 
15:29:27 2016
@@ -392,7 +392,7 @@ public class AjpProcessor extends Abstra
         // Setting up the socket
         this.socketWrapper = socket;
 
-        int soTimeout = endpoint.getSoTimeout();
+        int connectionTimeout = endpoint.getConnectionTimeout();
         boolean cping = false;
 
         boolean keptAlive = false;
@@ -406,7 +406,7 @@ public class AjpProcessor extends Abstra
                 }
                 // Set back timeout if keep alive timeout is enabled
                 if (keepAliveTimeout > 0) {
-                    socketWrapper.setReadTimeout(soTimeout);
+                    socketWrapper.setReadTimeout(connectionTimeout);
                 }
                 // Check message type, process right away and break if
                 // not regular request processing

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java Mon Oct 
31 15:29:27 2016
@@ -395,7 +395,7 @@ public class Http11InputBuffer implement
                     }
                     // At least one byte of the request has been received.
                     // Switch to the socket timeout.
-                    
wrapper.setReadTimeout(wrapper.getEndpoint().getSoTimeout());
+                    
wrapper.setReadTimeout(wrapper.getEndpoint().getConnectionTimeout());
                 }
                 if (!keptAlive && byteBuffer.position() == 0 && 
byteBuffer.limit() >= CLIENT_PREFACE_START.length - 1) {
                     boolean prefaceMatch = true;

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Mon Oct 31 
15:29:27 2016
@@ -839,9 +839,9 @@ public class Http11Processor extends Abs
             }
 
             if (!disableUploadTimeout) {
-                int soTimeout = endpoint.getSoTimeout();
-                if(soTimeout > 0) {
-                    socketWrapper.setReadTimeout(soTimeout);
+                int connectionTimeout = endpoint.getConnectionTimeout();
+                if(connectionTimeout > 0) {
+                    socketWrapper.setReadTimeout(connectionTimeout);
                 } else {
                     socketWrapper.setReadTimeout(0);
                 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Mon Oct 
31 15:29:27 2016
@@ -411,7 +411,7 @@ public abstract class AbstractEndpoint<S
     private Integer keepAliveTimeout = null;
     public int getKeepAliveTimeout() {
         if (keepAliveTimeout == null) {
-            return getSoTimeout();
+            return getConnectionTimeout();
         } else {
             return keepAliveTimeout.intValue();
         }
@@ -449,8 +449,8 @@ public abstract class AbstractEndpoint<S
      *
      * @return The current socket timeout for sockets created by this endpoint
      */
-    public int getSoTimeout() { return socketProperties.getSoTimeout(); }
-    public void setSoTimeout(int soTimeout) { 
socketProperties.setSoTimeout(soTimeout); }
+    public int getConnectionTimeout() { return 
socketProperties.getSoTimeout(); }
+    public void setConnectionTimeout(int soTimeout) { 
socketProperties.setSoTimeout(soTimeout); }
 
     /**
      * SSL engine.

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Mon Oct 31 
15:29:27 2016
@@ -795,8 +795,8 @@ public class AprEndpoint extends Abstrac
                 AprSocketWrapper wrapper = new 
AprSocketWrapper(Long.valueOf(socket), this);
                 wrapper.setKeepAliveLeft(getMaxKeepAliveRequests());
                 wrapper.setSecure(isSSLEnabled());
-                wrapper.setReadTimeout(getSoTimeout());
-                wrapper.setWriteTimeout(getSoTimeout());
+                wrapper.setReadTimeout(getConnectionTimeout());
+                wrapper.setWriteTimeout(getConnectionTimeout());
                 connections.put(Long.valueOf(socket), wrapper);
                 getExecutor().execute(new SocketWithOptionsProcessor(wrapper));
             }
@@ -1522,7 +1522,7 @@ public class AprEndpoint extends Abstrac
                 while (pollerRunning && connectionCount.get() < 1 &&
                         addList.size() < 1 && closeList.size() < 1) {
                     try {
-                        if (getSoTimeout() > 0 && pollerRunning) {
+                        if (getConnectionTimeout() > 0 && pollerRunning) {
                             maintain();
                         }
                         synchronized (this) {
@@ -1789,7 +1789,7 @@ public class AprEndpoint extends Abstrac
                 }
                 try {
                     // Process socket timeouts
-                    if (getSoTimeout() > 0 && pollerRunning) {
+                    if (getConnectionTimeout() > 0 && pollerRunning) {
                         // This works and uses only one timeout mechanism for 
everything, but the
                         // non event poller might be a bit faster by using the 
old maintain.
                         maintain();
@@ -1883,14 +1883,14 @@ public class AprEndpoint extends Abstrac
             if (size <= 0) {
                 size = (OS.IS_WIN32 || OS.IS_WIN64) ? (1 * 1024) : (16 * 1024);
             }
-            sendfilePollset = allocatePoller(size, pool, getSoTimeout());
+            sendfilePollset = allocatePoller(size, pool, 
getConnectionTimeout());
             if (sendfilePollset == 0 && size > 1024) {
                 size = 1024;
-                sendfilePollset = allocatePoller(size, pool, getSoTimeout());
+                sendfilePollset = allocatePoller(size, pool, 
getConnectionTimeout());
             }
             if (sendfilePollset == 0) {
                 size = 62;
-                sendfilePollset = allocatePoller(size, pool, getSoTimeout());
+                sendfilePollset = allocatePoller(size, pool, 
getConnectionTimeout());
             }
             desc = new long[size * 2];
             sendfileData = new HashMap<>(size);
@@ -1968,7 +1968,7 @@ public class AprEndpoint extends Abstrac
                             // Entire file has been sent
                             Pool.destroy(data.fdpool);
                             // Set back socket to blocking mode
-                            Socket.timeoutSet(data.socket, getSoTimeout() * 
1000);
+                            Socket.timeoutSet(data.socket, 
getConnectionTimeout() * 1000);
                             return SendfileState.DONE;
                         }
                     }
@@ -2098,7 +2098,7 @@ public class AprEndpoint extends Abstrac
                                     // Destroy file descriptor pool, which 
should close the file
                                     Pool.destroy(state.fdpool);
                                     Socket.timeoutSet(state.socket,
-                                            getSoTimeout() * 1000);
+                                            getConnectionTimeout() * 1000);
                                     // If all done put the socket back in the
                                     // poller for processing of further 
requests
                                     getPoller().add(
@@ -2131,7 +2131,7 @@ public class AprEndpoint extends Abstrac
                         }
                     }
                     // Call maintain for the sendfile poller
-                    if (getSoTimeout() > 0 &&
+                    if (getConnectionTimeout() > 0 &&
                             maintainTime > 1000000L && sendfileRunning) {
                         rv = Poll.maintain(sendfilePollset, desc, false);
                         maintainTime = 0;
@@ -2187,7 +2187,7 @@ public class AprEndpoint extends Abstrac
                 if (!deferAccept) {
                     if (setSocketOptions(socket)) {
                         getPoller().add(socket.getSocket().longValue(),
-                                getSoTimeout(), Poll.APR_POLLIN);
+                                getConnectionTimeout(), Poll.APR_POLLIN);
                     } else {
                         // Close socket and pool
                         closeSocket(socket.getSocket().longValue());

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Mon Oct 31 
15:29:27 2016
@@ -341,8 +341,8 @@ public class Nio2Endpoint extends Abstra
             
socketWrapper.setWriteTimeout(getSocketProperties().getSoTimeout());
             
socketWrapper.setKeepAliveLeft(Nio2Endpoint.this.getMaxKeepAliveRequests());
             socketWrapper.setSecure(isSSLEnabled());
-            socketWrapper.setReadTimeout(getSoTimeout());
-            socketWrapper.setWriteTimeout(getSoTimeout());
+            socketWrapper.setReadTimeout(getConnectionTimeout());
+            socketWrapper.setWriteTimeout(getConnectionTimeout());
             // Continue processing on another thread
             return processSocket(socketWrapper, SocketEvent.OPEN_READ, true);
         } catch (Throwable t) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Mon Oct 31 
15:29:27 2016
@@ -710,8 +710,8 @@ public class NioEndpoint extends Abstrac
             ka.setWriteTimeout(getSocketProperties().getSoTimeout());
             ka.setKeepAliveLeft(NioEndpoint.this.getMaxKeepAliveRequests());
             ka.setSecure(isSSLEnabled());
-            ka.setReadTimeout(getSoTimeout());
-            ka.setWriteTimeout(getSoTimeout());
+            ka.setReadTimeout(getConnectionTimeout());
+            ka.setWriteTimeout(getConnectionTimeout());
             PollerEvent r = eventCache.pop();
             ka.interestOps(SelectionKey.OP_READ);//this is what OP_REGISTER 
turns into.
             if ( r==null) r = new PollerEvent(socket,ka,OP_REGISTER);
@@ -1381,7 +1381,7 @@ public class NioEndpoint extends Abstrac
                 // Need to re-negotiate SSL connection
                 engine.setNeedClientAuth(true);
                 try {
-                    sslChannel.rehandshake(getEndpoint().getSoTimeout());
+                    
sslChannel.rehandshake(getEndpoint().getConnectionTimeout());
                     ((JSSESupport) sslSupport).setSession(engine.getSession());
                 } catch (IOException ioe) {
                     log.warn(sm.getString("socket.sslreneg",ioe));

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java?rev=1767307&r1=1767306&r2=1767307&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java Mon Oct 
31 15:29:27 2016
@@ -240,7 +240,8 @@ public class SecureNio2Channel extends N
                             sc.write(netOutBuffer, socket, 
handshakeWriteCompletionHandler);
                         } else {
                             try {
-                                
sc.write(netOutBuffer).get(endpoint.getSoTimeout(), TimeUnit.MILLISECONDS);
+                                
sc.write(netOutBuffer).get(endpoint.getConnectionTimeout(),
+                                        TimeUnit.MILLISECONDS);
                             } catch (InterruptedException | ExecutionException 
| TimeoutException e) {
                                 throw new 
IOException(sm.getString("channel.nio.ssl.handhakeError"));
                             }
@@ -273,7 +274,8 @@ public class SecureNio2Channel extends N
                             sc.write(netOutBuffer, socket, 
handshakeWriteCompletionHandler);
                         } else {
                             try {
-                                
sc.write(netOutBuffer).get(endpoint.getSoTimeout(), TimeUnit.MILLISECONDS);
+                                
sc.write(netOutBuffer).get(endpoint.getConnectionTimeout(),
+                                        TimeUnit.MILLISECONDS);
                             } catch (InterruptedException | ExecutionException 
| TimeoutException e) {
                                 throw new 
IOException(sm.getString("channel.nio.ssl.handhakeError"));
                             }
@@ -296,7 +298,8 @@ public class SecureNio2Channel extends N
                             sc.read(netInBuffer, socket, 
handshakeReadCompletionHandler);
                         } else {
                             try {
-                                
sc.read(netInBuffer).get(endpoint.getSoTimeout(), TimeUnit.MILLISECONDS);
+                                
sc.read(netInBuffer).get(endpoint.getConnectionTimeout(),
+                                        TimeUnit.MILLISECONDS);
                             } catch (InterruptedException | ExecutionException 
| TimeoutException e) {
                                 throw new 
IOException(sm.getString("channel.nio.ssl.handhakeError"));
                             }
@@ -527,7 +530,8 @@ public class SecureNio2Channel extends N
         sslEngine.closeOutbound();
 
         try {
-            if (!flush().get(endpoint.getSoTimeout(), 
TimeUnit.MILLISECONDS).booleanValue()) {
+            if (!flush().get(endpoint.getConnectionTimeout(),
+                    TimeUnit.MILLISECONDS).booleanValue()) {
                 throw new 
IOException(sm.getString("channel.nio.ssl.remainingDataDuringClose"));
             }
         } catch (InterruptedException | ExecutionException | TimeoutException 
e) {
@@ -547,7 +551,8 @@ public class SecureNio2Channel extends N
         netOutBuffer.flip();
         //if there is data to be written
         try {
-            if (!flush().get(endpoint.getSoTimeout(), 
TimeUnit.MILLISECONDS).booleanValue()) {
+            if (!flush().get(endpoint.getConnectionTimeout(),
+                    TimeUnit.MILLISECONDS).booleanValue()) {
                 throw new 
IOException(sm.getString("channel.nio.ssl.remainingDataDuringClose"));
             }
         } catch (InterruptedException | ExecutionException | TimeoutException 
e) {



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

Reply via email to