You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pe...@apache.org on 2008/11/07 22:40:37 UTC

svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

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


Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

Posted by Peter Rossbach <pr...@objektpark.de>.
Many thanks,

I will check at evening.

Peter



Am 11.11.2008 um 23:59 schrieb Filip Hanik - Dev Lists:

> done
>
> Filip
> Peter Rossbach wrote:
>> Yes, please
>> Peter
>>
>>
>> Am 11.11.2008 um 20:18 schrieb Filip Hanik - Dev Lists:
>>
>>> hi Peter, the one line patch is in my email,
>>> that is the patch that you should apply, instead of your patch
>>> socketProperties.setProperties(serverSock.socket());
>>>
>>> would you like me to do it?
>>> Filip
>>>
>>> Peter Rossbach wrote:
>>>> Hi Filip,
>>>>
>>>> I don't see the one line patch. I also the problem, but I got a  
>>>> lot of NPE without the patch.
>>>>
>>>> need help,
>>>>
>>>> Peter
>>>>
>>>>
>>>> Am 11.11.2008 um 18:06 schrieb Filip Hanik - Dev Lists:
>>>>
>>>>> -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
>>>>>
>>>>
>>>>
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> 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
>


Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
done

Filip
Peter Rossbach wrote:
> Yes, please
> Peter
>
>
> Am 11.11.2008 um 20:18 schrieb Filip Hanik - Dev Lists:
>
>> hi Peter, the one line patch is in my email,
>> that is the patch that you should apply, instead of your patch
>> socketProperties.setProperties(serverSock.socket());
>>
>> would you like me to do it?
>> Filip
>>
>> Peter Rossbach wrote:
>>> Hi Filip,
>>>
>>> I don't see the one line patch. I also the problem, but I got a lot 
>>> of NPE without the patch.
>>>
>>> need help,
>>>
>>> Peter
>>>
>>>
>>> Am 11.11.2008 um 18:06 schrieb Filip Hanik - Dev Lists:
>>>
>>>> -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
>>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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


Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

Posted by Peter Rossbach <pr...@objektpark.de>.
Yes, please
Peter


Am 11.11.2008 um 20:18 schrieb Filip Hanik - Dev Lists:

> hi Peter, the one line patch is in my email,
> that is the patch that you should apply, instead of your patch
> socketProperties.setProperties(serverSock.socket());
>
> would you like me to do it?
> Filip
>
> Peter Rossbach wrote:
>> Hi Filip,
>>
>> I don't see the one line patch. I also the problem, but I got a  
>> lot of NPE without the patch.
>>
>> need help,
>>
>> Peter
>>
>>
>> Am 11.11.2008 um 18:06 schrieb Filip Hanik - Dev Lists:
>>
>>> -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
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
hi Peter, the one line patch is in my email,
that is the patch that you should apply, instead of your patch
socketProperties.setProperties(serverSock.socket());

would you like me to do it?
Filip

Peter Rossbach wrote:
> Hi Filip,
>
> I don't see the one line patch. I also the problem, but I got a lot of 
> NPE without the patch.
>
> need help,
>
> Peter
>
>
> Am 11.11.2008 um 18:06 schrieb Filip Hanik - Dev Lists:
>
>> -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
>>
>
>


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


Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

Posted by Peter Rossbach <pr...@objektpark.de>.
Hi Filip,

I don't see the one line patch. I also the problem, but I got a lot  
of NPE without the patch.

need help,

Peter


Am 11.11.2008 um 18:06 schrieb Filip Hanik - Dev Lists:

> -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
>


Re: svn commit: r712278 - in /tomcat/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SocketProperties.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
-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