Author: markt Date: Sat Jul 7 18:44:54 2012 New Revision: 1358617 URL: http://svn.apache.org/viewvc?rev=1358617&view=rev Log: Cannot set traffic class on a socket returned from accept(). On Java 6 it is always ignored. On Java 7 BIO ignores it, NIO throws an Exception
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml tomcat/tc7.0.x/trunk/webapps/docs/config/ajp.xml tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1358613 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java?rev=1358617&r1=1358616&r2=1358617&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Sat Jul 7 18:44:54 2012 @@ -139,16 +139,6 @@ public class SocketProperties { protected Integer soTimeout = new Integer(20000); /** - * Traffic class option, value between 0 and 255 - * IPTOS_LOWCOST (0x02) - * IPTOS_RELIABILITY (0x04) - * IPTOS_THROUGHPUT (0x08) - * IPTOS_LOWDELAY (0x10) - * JVM default used if not set - */ - protected Integer soTrafficClass = null; - - /** * Performance preferences according to * http://docs.oracle.com/javase/1.5.0/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int) * All three performance attributes must be set or the JVM defaults will be @@ -207,8 +197,6 @@ public class SocketProperties { socket.setSoTimeout(soTimeout.intValue()); if (tcpNoDelay != null) socket.setTcpNoDelay(tcpNoDelay.booleanValue()); - if (soTrafficClass != null) - socket.setTrafficClass(soTrafficClass.intValue()); } public void setProperties(ServerSocket socket) throws SocketException{ @@ -271,10 +259,6 @@ public class SocketProperties { return soTimeout.intValue(); } - public int getSoTrafficClass() { - return soTrafficClass.intValue(); - } - public boolean getTcpNoDelay() { return tcpNoDelay.booleanValue(); } @@ -332,10 +316,6 @@ public class SocketProperties { this.tcpNoDelay = Boolean.valueOf(tcpNoDelay); } - public void setSoTrafficClass(int soTrafficClass) { - this.soTrafficClass = Integer.valueOf(soTrafficClass); - } - public void setSoTimeout(int soTimeout) { this.soTimeout = Integer.valueOf(soTimeout); } Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1358617&r1=1358616&r2=1358617&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat Jul 7 18:44:54 2012 @@ -68,6 +68,15 @@ </fix> </changelog> </subsection> + <subsection name="Coyote"> + <changelog> + <fix> + Remove the <code>socket.soTrafficClass</code> from the BIO and NIO + HTTP and AJP connectors because any use of the option is either ignored + or in some cases (Java 7 with NIO) throws an Exception. (mark) + </fix> + </changelog> + </subsection> <subsection name="Cluster"> <changelog> <fix> Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/ajp.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/ajp.xml?rev=1358617&r1=1358616&r2=1358617&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/config/ajp.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/config/ajp.xml Sat Jul 7 18:44:54 2012 @@ -479,14 +479,6 @@ <p>This is equivalent to standard attribute <strong>connectionTimeout</strong>.</p> </attribute> - <attribute name="socket.soTrafficClass" required="false"> - <p>(byte)Value between <code>0</code> and <code>255</code> for the - traffic class on the socket. JVM default used if not set.</p> - <p><strong>Note:</strong> On some JDK versions, setting - <strong>soTrafficClass</strong> causes a problem. A work around for this - is to add the <code>-Djava.net.preferIPv4Stack=true</code> value to your - JVM options.</p> - </attribute> <attribute name="socket.performanceConnectionTime" required="false"> <p>(int)The first value for the performance settings. See <a href="http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket Performance Options</a> Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml?rev=1358617&r1=1358616&r2=1358617&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml Sat Jul 7 18:44:54 2012 @@ -558,14 +558,6 @@ <p>This is equivalent to standard attribute <strong>connectionTimeout</strong>.</p> </attribute> - <attribute name="socket.soTrafficClass" required="false"> - <p>(byte)Value between <code>0</code> and <code>255</code> for the - traffic class on the socket. JVM default used if not set.</p> - <p><strong>Note:</strong> On some JDK versions, setting - <strong>soTrafficClass</strong> causes a problem. A work around for this - is to add the <code>-Djava.net.preferIPv4Stack=true</code> value to your - JVM options.</p> - </attribute> <attribute name="socket.performanceConnectionTime" required="false"> <p>(int)The first value for the performance settings. See <a href="http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setPerformancePreferences(int,%20int,%20int)">Socket Performance Options</a> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org