Author: markt Date: Fri Sep 5 14:52:54 2014 New Revision: 1622714 URL: http://svn.apache.org/r1622714 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56910 -1 is not a supported option for maxConnections with the APR connector so don't allow it. Also prevent updates while the connector is running which is also unsupported.
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1622713 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1622714&r1=1622713&r2=1622714&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep 5 14:52:54 2014 @@ -355,6 +355,28 @@ public class AprEndpoint extends Abstrac } + /** + * This endpoint does not support <code>-1</code> for unlimited connections, + * nor does it support setting this attribute while the endpoint is running. + * + * {@inheritDoc} + */ + @Override + public void setMaxConnections(int maxConnections) { + if (maxConnections == -1) { + log.warn(sm.getString("endpoint.apr.maxConnections.unlimited", + Integer.valueOf(getMaxConnections()))); + return; + } + if (running) { + log.warn(sm.getString("endpoint.apr.maxConnections.running", + Integer.valueOf(getMaxConnections()))); + return; + } + super.setMaxConnections(maxConnections); + } + + // --------------------------------------------------------- Public Methods /** Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties?rev=1622714&r1=1622713&r2=1622714&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties Fri Sep 5 14:52:54 2014 @@ -50,6 +50,8 @@ endpoint.sendfile.addfail=Sendfile failu endpoint.timeout.err=Error processing socket timeout endpoint.apr.failSslContextMake=Unable to create SSLContext. Check that SSLEngine is enabled in the AprLifecycleListener, the AprLifecycleListener has initialised correctly and that a valid SSLProtocol has been specified endpoint.apr.invalidSslProtocol=An invalid value [{0}] was provided for the SSLProtocol attribute +endpoint.apr.maxConnections.running=The APR endpoint does not support the setting of maxConnections while it is running. The existing value of [{0}] will continue to be used. +endpoint.apr.maxConnections.unlimited=The APR endpoint does not support unlimited connections. The existing value of [{0}] will continue to be used. endpoint.apr.noSslCertFile=Connector attribute SSLCertificateFile must be defined when using SSL with APR endpoint.apr.pollAddInvalid=Invalid attempted to add a socket [{0}] to the poller endpoint.apr.pollError=Poller failed with error [{0}] : [{1}] 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=1622714&r1=1622713&r2=1622714&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Fri Sep 5 14:52:54 2014 @@ -153,6 +153,10 @@ <bug>56780</bug>: Enable Tomcat to start when using SSL with an IBM JRE in strict SP800-131a mode. (markt) </fix> + <fix> + <bug>56910</bug>: Prevent the invalid value of <code>-1</code> being + used for <code>maxConnections</code> with APR connectors. (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org