tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java
Date Tue, 11 Nov 2008 17:06:23 GMT
-1

this was intentional, and yes, it accidentally broke the NIO connector
the proper way to do this is to call

socketProperties.setProperties(serverSock.socket());

this way, your patch is only one line, and also doesn't add in a bunch of -1 illegal values

Filip


pero@apache.org wrote:
> Author: pero
> Date: Fri Nov  7 13:40:37 2008
> New Revision: 712278
>
> URL: http://svn.apache.org/viewvc?rev=712278&view=rev
> Log:
> Fix NPE to use Http11NioProtocol handler with default parameters!
> # example:
> <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
>         maxThreads="150" minSpareThreads="4"/>
> <Connector executor="tomcatThreadPool"
>                port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" 
>                connectionTimeout="20000" 
>                redirectPort="8443" />
>
> Used at MAC OS X with "-Djava.net.preferIPv4Stack=true"
>
> I am not sure that default returns are correct!
>
> Modified:
>     tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
>     tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java
>
> 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=712278&r1=712277&r2=712278&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri Nov  7 13:40:37
2008
> @@ -735,7 +735,12 @@
>              return;
>  
>          serverSock = ServerSocketChannel.open();
> -        serverSock.socket().setPerformancePreferences(socketProperties.getPerformanceConnectionTime(),
> +        int performanceConnectionTime = socketProperties.getPerformanceConnectionTime();
> +        int performanceLatency= socketProperties.getPerformanceLatency();
> +        int performanceBandwidth = socketProperties.getPerformanceBandwidth();
> +        if (performanceConnectionTime != -1 && performanceLatency != -1 &&
> +                performanceBandwidth != -1)
> +            serverSock.socket().setPerformancePreferences(socketProperties.getPerformanceConnectionTime(),
>                                                        socketProperties.getPerformanceLatency(),
>                                                        socketProperties.getPerformanceBandwidth());
>          InetSocketAddress addr = (address!=null?new InetSocketAddress(address,port):new
InetSocketAddress(port));
>
> Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java?rev=712278&r1=712277&r2=712278&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Fri Nov  7 13:40:37
2008
> @@ -210,55 +210,82 @@
>      }
>  
>      public boolean getOoBInline() {
> -        return ooBInline.booleanValue();
> +        if(ooBInline != null)
> +            return ooBInline.booleanValue();
> +        return false;
>      }
>  
>      public int getPerformanceBandwidth() {
> -        return performanceBandwidth.intValue();
> +        if(performanceBandwidth != null)
> +            return performanceBandwidth.intValue();
> +        return -1;
>      }
>  
>      public int getPerformanceConnectionTime() {
> -        return performanceConnectionTime.intValue();
> +        if(performanceConnectionTime!= null)
> +            return performanceConnectionTime.intValue();
> +        return -1;
> +          
>      }
>  
>      public int getPerformanceLatency() {
> -        return performanceLatency.intValue();
> +        if(performanceLatency != null)
> +            return performanceLatency.intValue();
> +        return -1 ;
>      }
>  
>      public int getRxBufSize() {
> -        return rxBufSize.intValue();
> +        if(rxBufSize != null)
> +            return rxBufSize.intValue();
> +        return -1;
>      }
>  
>      public boolean getSoKeepAlive() {
> -        return soKeepAlive.booleanValue();
> +        if(soKeepAlive != null)
> +            return soKeepAlive.booleanValue();
> +        return false;
>      }
>  
>      public boolean getSoLingerOn() {
> -        return soLingerOn.booleanValue();
> +        if(soLingerOn != null)
> +            return soLingerOn.booleanValue();
> +        return false;
>      }
>  
>      public int getSoLingerTime() {
> -        return soLingerTime.intValue();
> +        if(soLingerTime != null)
> +            return soLingerTime.intValue();
> +        return -1;
>      }
>  
>      public boolean getSoReuseAddress() {
> -        return soReuseAddress.booleanValue();
> +        if(soReuseAddress != null)
> +            return soReuseAddress.booleanValue();
> +        return false;
>      }
>  
>      public int getSoTimeout() {
> -        return soTimeout.intValue();
> +        if(soTimeout != null)
> +            return soTimeout.intValue();
> +        return -1;
>      }
>  
>      public int getSoTrafficClass() {
> -        return soTrafficClass.intValue();
> +        if(soTrafficClass != null)
> +            return soTrafficClass.intValue();
> +        return -1;
>      }
>  
>      public boolean getTcpNoDelay() {
> -        return tcpNoDelay.booleanValue();
> +        if(tcpNoDelay != null)
> +            return tcpNoDelay.booleanValue();
> +        return false;
>      }
>  
>      public int getTxBufSize() {
> -        return txBufSize.intValue();
> +        if(txBufSize != null)
> +            return txBufSize.intValue();
> +        return -1;
>      }
>  
>      public int getBufferPool() {
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>   


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


Mime
View raw message