Author: markt Date: Fri Sep 5 14:48:47 2014 New Revision: 1622713 URL: http://svn.apache.org/r1622713 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/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1622713&r1=1622712&r2=1622713&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep 5 14:48:47 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/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties?rev=1622713&r1=1622712&r2=1622713&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties Fri Sep 5 14:48:47 2014 @@ -52,6 +52,8 @@ endpoint.setAttribute=Set [{0}] to [{1}] 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.noSendfileWithSSL=Sendfile is not supported for the APR/native connector when SSL is enabled 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 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org