tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: svn commit: r1832744 - /tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java
Date Sat, 02 Jun 2018 20:38:49 GMT
Rémy,

On 6/2/18 3:40 PM, remm@apache.org wrote:
> Author: remm
> Date: Sat Jun  2 19:40:31 2018
> New Revision: 1832744
> 
> URL: http://svn.apache.org/viewvc?rev=1832744&view=rev
> Log:
> Add more missing timeouts, submitted by Alex Marchevskiy.
> 
> Modified:
>     tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java
> 
> 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=1832744&r1=1832743&r2=1832744&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java Sat Jun  2 19:40:31
2018
> @@ -371,7 +371,8 @@ public class SecureNio2Channel extends N
>          // an optimisation for the typical case so we don't create an
>          // SNIExtractor only to discover there is no data to process
>          if (netInBuffer.position() == 0) {
> -            sc.read(netInBuffer, socket, handshakeReadCompletionHandler);
> +            sc.read(netInBuffer, Nio2Endpoint.toNio2Timeout(endpoint.getConnectionTimeout()),
> +                    TimeUnit.MILLISECONDS, socket, handshakeReadCompletionHandler);

Is "Nio2Endpoint.toNio2Timeout(endpoint.getConnectionTimeout())", etc.
something worth computing once and storing? I know its a simple
comparison, but it could improve CPU usage/performance a small amount.

-chris


Mime
View raw message