You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2008/11/19 23:14:57 UTC

svn commit: r719093 - /tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java

Author: fhanik
Date: Wed Nov 19 14:14:57 2008
New Revision: 719093

URL: http://svn.apache.org/viewvc?rev=719093&view=rev
Log:
keep the correct default value

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java

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=719093&r1=719092&r2=719093&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Wed Nov 19 14:14:57 2008
@@ -104,7 +104,7 @@
     /**
      * TCP_NO_DELAY option. JVM default used if not set.
      */
-    protected Boolean tcpNoDelay = null;
+    protected Boolean tcpNoDelay = Boolean.TRUE;
 
     /**
      * SO_KEEPALIVE option. JVM default used if not set.



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


Re: svn commit: r719093 - /tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

look for tcpNoDelay

there has been a default for years

Filip

Tim Funk wrote:
> This doesn't make sense to me. The Javadoc and the code check for null 
> to allow the use of the default value in the JVM. This patch makes all 
> of that invalid and sets it to true.
>
> So either
> 1) this would need reverted -or-
> 2) Or the if (tcpNoDelay != null) needs removed - or -
> 3) The comments get updated (not sure if there associated docs too)
>
> But by defaulting the value to Boolean.TRUE - it does eliminate the 
> chance of a NPE here:
>     public boolean getTcpNoDelay() {
>         return tcpNoDelay.booleanValue();
>     }
>
> I'm indifferent on the fix. (Just the code comment VS code inconsistency)
>
>
> -Tim
>
> fhanik@apache.org wrote:
>> Author: fhanik
>> Date: Wed Nov 19 14:14:57 2008
>> New Revision: 719093
>>
>> URL: http://svn.apache.org/viewvc?rev=719093&view=rev
>> Log:
>> keep the correct default value
>>
>> Modified:
>>     tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java
>>
>> 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=719093&r1=719092&r2=719093&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java 
>> (original)
>> +++ 
>> tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java 
>> Wed Nov 19 14:14:57 2008
>> @@ -104,7 +104,7 @@
>>      /**
>>       * TCP_NO_DELAY option. JVM default used if not set.
>>       */
>> -    protected Boolean tcpNoDelay = null;
>> +    protected Boolean tcpNoDelay = Boolean.TRUE;
>>  
>>      /**
>>       * SO_KEEPALIVE option. JVM default used if not set.
>
>
> ---------------------------------------------------------------------
> 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: r719093 - /tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java

Posted by Tim Funk <fu...@joedog.org>.
This doesn't make sense to me. The Javadoc and the code check for null 
to allow the use of the default value in the JVM. This patch makes all 
of that invalid and sets it to true.

So either
1) this would need reverted -or-
2) Or the if (tcpNoDelay != null) needs removed - or -
3) The comments get updated (not sure if there associated docs too)

But by defaulting the value to Boolean.TRUE - it does eliminate the 
chance of a NPE here:
     public boolean getTcpNoDelay() {
         return tcpNoDelay.booleanValue();
     }

I'm indifferent on the fix. (Just the code comment VS code inconsistency)


-Tim

fhanik@apache.org wrote:
> Author: fhanik
> Date: Wed Nov 19 14:14:57 2008
> New Revision: 719093
> 
> URL: http://svn.apache.org/viewvc?rev=719093&view=rev
> Log:
> keep the correct default value
> 
> Modified:
>     tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java
> 
> 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=719093&r1=719092&r2=719093&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original)
> +++ tomcat/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Wed Nov 19 14:14:57 2008
> @@ -104,7 +104,7 @@
>      /**
>       * TCP_NO_DELAY option. JVM default used if not set.
>       */
> -    protected Boolean tcpNoDelay = null;
> +    protected Boolean tcpNoDelay = Boolean.TRUE;
>  
>      /**
>       * SO_KEEPALIVE option. JVM default used if not set.


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