JBossWeb SVN: r1861 - trunk/java/org/apache/jasper/runtime.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-28 11:29:40 -0400 (Fri, 28 Oct 2011)
New Revision: 1861
Modified:
trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
Log:
- Port performance patch by dropping not so useful logging. I don't see how it really changes things for web,
since it won't unload JSPs.
Modified: trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2011-10-28 09:26:16 UTC (rev 1860)
+++ trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 2011-10-28 15:29:40 UTC (rev 1861)
@@ -136,15 +136,13 @@
try {
ptd.handlers[i].release();
} catch (Exception e) {
- log.warn("Error processing release on tag instance of "
- + ptd.handlers[i].getClass().getName(), e);
+ // Ignore
}
if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
try {
instanceManager.destroyInstance(ptd.handlers[i]);
} catch (Exception e) {
- log.warn("Error processing preDestroy on tag instance of "
- + ptd.handlers[i].getClass().getName(), e);
+ // Ignore
}
}
}
Modified: trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/TagHandlerPool.java 2011-10-28 09:26:16 UTC (rev 1860)
+++ trunk/java/org/apache/jasper/runtime/TagHandlerPool.java 2011-10-28 15:29:40 UTC (rev 1861)
@@ -37,8 +37,6 @@
public static final String OPTION_TAGPOOL="tagpoolClassName";
public static final String OPTION_MAXSIZE="tagpoolMaxSize";
- protected Logger log = Logger.getLogger(TagHandlerPool.class);
-
// index of next available tag handler
private int current;
protected InstanceManager instanceManager = null;
@@ -163,8 +161,7 @@
try {
instanceManager.destroyInstance(handlers[i]);
} catch (Exception e) {
- log.warn("Error processing preDestroy on tag instance of "
- + handlers[i].getClass().getName(), e);
+ // Ignore
}
}
}
13 years, 1 month
JBossWeb SVN: r1860 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-28 05:26:16 -0400 (Fri, 28 Oct 2011)
New Revision: 1860
Added:
tags/JBOSSWEB_7_0_3_FINAL/
Log:
Web 7.0.3
13 years, 1 month
JBossWeb SVN: r1859 - trunk/java/org/apache/tomcat/util/buf.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-28 05:24:59 -0400 (Fri, 28 Oct 2011)
New Revision: 1859
Modified:
trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
Log:
- Add utility method.
Modified: trunk/java/org/apache/tomcat/util/buf/B2CConverter.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/B2CConverter.java 2011-10-27 21:56:10 UTC (rev 1858)
+++ trunk/java/org/apache/tomcat/util/buf/B2CConverter.java 2011-10-28 09:24:59 UTC (rev 1859)
@@ -67,6 +67,10 @@
leftovers.position(0);
}
+ public boolean isUndeflow() {
+ return (leftovers.position() > 0);
+ }
+
/**
* Convert the given bytes to characters.
*
13 years, 1 month
JBossWeb SVN: r1858 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-27 17:56:10 -0400 (Thu, 27 Oct 2011)
New Revision: 1858
Modified:
trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
trunk/java/org/apache/tomcat/util/http/Parameters.java
trunk/webapps/docs/changelog.xml
Log:
Add system properties which restrict parameter count (org.apache.tomcat.util.http.Parameters.MAX_COUNT default to 512) and header count (org.apache.tomcat.util.http.MimeHeaders.MAX_COUNT to 128).
Modified: trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/MimeHeaders.java 2011-10-27 16:52:51 UTC (rev 1857)
+++ trunk/java/org/apache/tomcat/util/http/MimeHeaders.java 2011-10-27 21:56:10 UTC (rev 1858)
@@ -23,9 +23,6 @@
import org.apache.tomcat.util.buf.MessageBytes;
-/* XXX XXX XXX Need a major rewrite !!!!
- */
-
/**
* This class is used to contain standard internet message headers,
* used for SMTP (RFC822) and HTTP (RFC2068) messages as well as for
@@ -77,12 +74,6 @@
* to avoid inside tomcat. The goal is to use _only_ MessageByte-based Fields,
* and reduce to 0 the memory overhead of tomcat.
*
- * TODO:
- * XXX one-buffer parsing - for http ( other protocols don't need that )
- * XXX remove unused methods
- * XXX External enumerations, with 0 GC.
- * XXX use HeaderName ID
- *
*
* @author dac(a)eng.sun.com
* @author James Todd [gonzo(a)eng.sun.com]
@@ -212,9 +203,10 @@
}
/** Initial size - should be == average number of headers per request
- * XXX make it configurable ( fine-tuning of web-apps )
*/
public static final int DEFAULT_HEADER_SIZE = 8;
+ protected static final int MAX_COUNT =
+ Integer.valueOf(System.getProperty("org.apache.tomcat.util.http.MimeHeaders.MAX_COUNT", "128")).intValue();
/**
* The header fields.
@@ -333,6 +325,9 @@
MimeHeaderField mh;
int len = headers.length;
if (count >= len) {
+ if (count >= MAX_COUNT) {
+ throw new IllegalStateException("Header count exceeded allowed maximum: " + MAX_COUNT);
+ }
// expand header list array
MimeHeaderField tmp[] = new MimeHeaderField[count * 2];
System.arraycopy(headers, 0, tmp, 0, len);
@@ -441,9 +436,7 @@
* @param name the name of the header field to be removed
*/
public void removeHeader(String name) {
- // XXX
// warning: rather sticky code; heavily tuned
-
for (int i = 0; i < count; i++) {
if (headers[i].getName().equalsIgnoreCase(name)) {
removeHeader(i--);
Modified: trunk/java/org/apache/tomcat/util/http/Parameters.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/Parameters.java 2011-10-27 16:52:51 UTC (rev 1857)
+++ trunk/java/org/apache/tomcat/util/http/Parameters.java 2011-10-27 21:56:10 UTC (rev 1858)
@@ -40,6 +40,8 @@
protected static final int LAST = -1;
public static final int INITIAL_SIZE = 8;
protected static final String[] ARRAY_TYPE = new String[0];
+ protected static final int MAX_COUNT =
+ Integer.valueOf(System.getProperty("org.apache.tomcat.util.http.Parameters.MAX_COUNT", "512")).intValue();
protected class Field {
MessageBytes name = MessageBytes.newInstance();
@@ -212,6 +214,9 @@
int len = fields.length;
int pos = count;
if (count >= len) {
+ if (count >= MAX_COUNT) {
+ throw new IllegalStateException("Parameter count exceeded allowed maximum: " + MAX_COUNT);
+ }
// expand header list array
Field tmp[] = new Field[pos * 2];
System.arraycopy(fields, 0, tmp, 0, len);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-10-27 16:52:51 UTC (rev 1857)
+++ trunk/webapps/docs/changelog.xml 2011-10-27 21:56:10 UTC (rev 1858)
@@ -44,6 +44,10 @@
Add a limit on the number of parameters that can be parsed in a POST (1024 by default,
configured with org.apache.tomcat.util.http.Parameters.MAX_COUNT). (remm)
</fix>
+ <fix>
+ Add system properties which restrict parameter count (org.apache.tomcat.util.http.Parameters.MAX_COUNT
+ default to 512) and header count (org.apache.tomcat.util.http.MimeHeaders.MAX_COUNT to 128). (remm)
+ </fix>
</changelog>
</subsection>
</section>
13 years, 1 month
JBossWeb SVN: r1857 - in trunk: java/org/apache/catalina/session and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-27 12:52:51 -0400 (Thu, 27 Oct 2011)
New Revision: 1857
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/session/PersistentManagerBase.java
trunk/java/org/apache/catalina/session/StandardManager.java
trunk/webapps/docs/changelog.xml
Log:
- Move setting session timeout to Context.start.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2011-10-27 16:25:57 UTC (rev 1856)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2011-10-27 16:52:51 UTC (rev 1857)
@@ -3804,6 +3804,11 @@
setManager(contextManager);
}
+ // Configure the session timeout
+ if (manager != null) {
+ manager.setMaxInactiveInterval(sessionTimeout * 60);
+ }
+
if (manager!=null && (getCluster() != null) && distributable) {
//let the cluster know that there is a context that is distributable
//and that it has its own manager
Modified: trunk/java/org/apache/catalina/session/PersistentManagerBase.java
===================================================================
--- trunk/java/org/apache/catalina/session/PersistentManagerBase.java 2011-10-27 16:25:57 UTC (rev 1856)
+++ trunk/java/org/apache/catalina/session/PersistentManagerBase.java 2011-10-27 16:52:51 UTC (rev 1857)
@@ -341,8 +341,6 @@
// Register with the new Container (if any)
if ((this.container != null) && (this.container instanceof Context)) {
- setMaxInactiveInterval
- ( ((Context) this.container).getSessionTimeout()*60 );
((Context) this.container).addPropertyChangeListener(this);
}
Modified: trunk/java/org/apache/catalina/session/StandardManager.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardManager.java 2011-10-27 16:25:57 UTC (rev 1856)
+++ trunk/java/org/apache/catalina/session/StandardManager.java 2011-10-27 16:52:51 UTC (rev 1857)
@@ -178,8 +178,6 @@
// Register with the new Container (if any)
if ((this.container != null) && (this.container instanceof Context)) {
- setMaxInactiveInterval
- ( ((Context) this.container).getSessionTimeout()*60 );
((Context) this.container).addPropertyChangeListener(this);
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-10-27 16:25:57 UTC (rev 1856)
+++ trunk/webapps/docs/changelog.xml 2011-10-27 16:52:51 UTC (rev 1857)
@@ -25,6 +25,10 @@
<fix>
<jira>AS7-2073</jira>: Delegate connector lifecycle handling if in delay mode. (jfclere, remm)
</fix>
+ <fix>
+ For compatibility with managers which don't extend StandardManager, set the session timeout
+ from Context.start, so that it is always propagated. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -36,6 +40,10 @@
Add org.apache.tomcat.util.net.WAIT_FOR_THREAD system property to bring back optional
blocking for the thread pool. (remm)
</fix>
+ <fix>
+ Add a limit on the number of parameters that can be parsed in a POST (1024 by default,
+ configured with org.apache.tomcat.util.http.Parameters.MAX_COUNT). (remm)
+ </fix>
</changelog>
</subsection>
</section>
13 years, 1 month
JBossWeb SVN: r1856 - trunk/java/org/apache/catalina/session.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-27 12:25:57 -0400 (Thu, 27 Oct 2011)
New Revision: 1856
Modified:
trunk/java/org/apache/catalina/session/ManagerBase.java
Log:
- Port patch to align the default from context.
Modified: trunk/java/org/apache/catalina/session/ManagerBase.java
===================================================================
--- trunk/java/org/apache/catalina/session/ManagerBase.java 2011-10-25 22:17:30 UTC (rev 1855)
+++ trunk/java/org/apache/catalina/session/ManagerBase.java 2011-10-27 16:25:57 UTC (rev 1856)
@@ -87,7 +87,7 @@
* The default maximum inactive interval for Sessions created by
* this Manager.
*/
- protected int maxInactiveInterval = 60;
+ protected int maxInactiveInterval = 30 * 60;
/**
13 years, 1 month
JBossWeb SVN: r1855 - branches/2.1.x/java/org/apache/naming/resources.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2011-10-25 18:17:30 -0400 (Tue, 25 Oct 2011)
New Revision: 1855
Modified:
branches/2.1.x/java/org/apache/naming/resources/FileDirContext.java
branches/2.1.x/java/org/apache/naming/resources/WARDirContext.java
Log:
Fix concurrency issue with sharing InputStreams in JBossWeb [JBPAPP-7401].
Modified: branches/2.1.x/java/org/apache/naming/resources/FileDirContext.java
===================================================================
--- branches/2.1.x/java/org/apache/naming/resources/FileDirContext.java 2011-10-21 10:17:39 UTC (rev 1854)
+++ branches/2.1.x/java/org/apache/naming/resources/FileDirContext.java 2011-10-25 22:17:30 UTC (rev 1855)
@@ -878,7 +878,7 @@
/**
- * This specialized resource implementation avoids opening the IputStream
+ * This specialized resource implementation avoids opening the InputStream
* to the file right away (which would put a lock on the file).
*/
protected class FileResource extends Resource {
@@ -918,7 +918,9 @@
public InputStream streamContent()
throws IOException {
if (binaryContent == null) {
- inputStream = new FileInputStream(file);
+ FileInputStream fis = new FileInputStream(file);
+ inputStream = fis;
+ return fis;
}
return super.streamContent();
}
Modified: branches/2.1.x/java/org/apache/naming/resources/WARDirContext.java
===================================================================
--- branches/2.1.x/java/org/apache/naming/resources/WARDirContext.java 2011-10-21 10:17:39 UTC (rev 1854)
+++ branches/2.1.x/java/org/apache/naming/resources/WARDirContext.java 2011-10-25 22:17:30 UTC (rev 1855)
@@ -938,7 +938,9 @@
throws IOException {
try {
if (binaryContent == null) {
- inputStream = base.getInputStream(entry);
+ InputStream is = base.getInputStream(entry);
+ inputStream = is;
+ return is;
}
} catch (ZipException e) {
throw new IOException(e.getMessage());
13 years, 2 months
JBossWeb SVN: r1854 - in trunk: java/org/apache/coyote/http11 and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-21 06:17:39 -0400 (Fri, 21 Oct 2011)
New Revision: 1854
Added:
trunk/java/org/apache/tomcat/util/net/Constants.java
Modified:
trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
trunk/java/org/apache/coyote/ajp/AjpProcessor.java
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
trunk/webapps/docs/changelog.xml
Log:
- Add a flag for optional blocking in the thread pool, which can help testing.
- Move some constants.
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -631,7 +631,7 @@
log.error(sm.getString("ajpprocessor.certs.fail"), e);
return;
}
- request.setAttribute(AprEndpoint.CERTIFICATE_KEY, jsseCerts);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, jsseCerts);
}
} else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE) {
@@ -844,19 +844,19 @@
case Constants.SC_A_SSL_CIPHER :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(AprEndpoint.CIPHER_SUITE_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CIPHER_SUITE_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_SESSION :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(AprEndpoint.SESSION_ID_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.SESSION_ID_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_KEY_SIZE :
- request.setAttribute(AprEndpoint.KEY_SIZE_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.KEY_SIZE_KEY,
new Integer(requestHeaderMessage.getInt()));
break;
Modified: trunk/java/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/java/org/apache/coyote/ajp/AjpProcessor.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -645,7 +645,7 @@
log.error(sm.getString("ajpprocessor.certs.fail"), e);
return;
}
- request.setAttribute(JIoEndpoint.CERTIFICATE_KEY, jsseCerts);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, jsseCerts);
}
} else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE) {
@@ -858,19 +858,19 @@
case Constants.SC_A_SSL_CIPHER :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(JIoEndpoint.CIPHER_SUITE_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CIPHER_SUITE_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_SESSION :
request.scheme().setString("https");
requestHeaderMessage.getBytes(tmpMB);
- request.setAttribute(JIoEndpoint.SESSION_ID_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.SESSION_ID_KEY,
tmpMB.toString());
break;
case Constants.SC_A_SSL_KEY_SIZE :
- request.setAttribute(JIoEndpoint.KEY_SIZE_KEY,
+ request.setAttribute(org.apache.tomcat.util.net.Constants.KEY_SIZE_KEY,
new Integer(requestHeaderMessage.getInt()));
break;
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -1176,7 +1176,7 @@
// Cipher suite
Object sslO = SSLSocket.getInfoS(socket, SSL.SSL_INFO_CIPHER);
if (sslO != null) {
- request.setAttribute(AprEndpoint.CIPHER_SUITE_KEY, sslO);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CIPHER_SUITE_KEY, sslO);
}
// Get client certificate and the certificate chain if present
// certLength == -1 indicates an error
@@ -1193,15 +1193,15 @@
}
}
if (certs != null) {
- request.setAttribute(AprEndpoint.CERTIFICATE_KEY, certs);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, certs);
}
// User key size
sslO = new Integer(SSLSocket.getInfoI(socket, SSL.SSL_INFO_CIPHER_USEKEYSIZE));
- request.setAttribute(AprEndpoint.KEY_SIZE_KEY, sslO);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.KEY_SIZE_KEY, sslO);
// SSL session ID
sslO = SSLSocket.getInfoS(socket, SSL.SSL_INFO_SESSION_ID);
if (sslO != null) {
- request.setAttribute(AprEndpoint.SESSION_ID_KEY, sslO);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.SESSION_ID_KEY, sslO);
}
} catch (Exception e) {
log.warn(sm.getString("http11processor.socket.ssl"), e);
@@ -1240,7 +1240,7 @@
}
}
if (certs != null) {
- request.setAttribute(AprEndpoint.CERTIFICATE_KEY, certs);
+ request.setAttribute(org.apache.tomcat.util.net.Constants.CERTIFICATE_KEY, certs);
}
}
} catch (Exception e) {
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -65,28 +65,6 @@
StringManager.getManager("org.apache.tomcat.util.net.res");
- /**
- * The Request attribute key for the cipher suite.
- */
- public static final String CIPHER_SUITE_KEY = "javax.servlet.request.cipher_suite";
-
- /**
- * The Request attribute key for the key size.
- */
- public static final String KEY_SIZE_KEY = "javax.servlet.request.key_size";
-
- /**
- * The Request attribute key for the client certificate chain.
- */
- public static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
-
- /**
- * The Request attribute key for the session id.
- * This one is a Tomcat extension to the Servlet spec.
- */
- public static final String SESSION_ID_KEY = "javax.servlet.request.ssl_session";
-
-
// ----------------------------------------------------------------- Fields
@@ -953,7 +931,8 @@
protected Worker getWorkerThread() {
// Allocate a new worker thread
Worker workerThread = createWorkerThread();
- if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
+ if (org.apache.tomcat.util.net.Constants.WAIT_FOR_THREAD
+ || org.apache.tomcat.util.Constants.LOW_MEMORY) {
while (workerThread == null) {
try {
synchronized (workers) {
Added: trunk/java/org/apache/tomcat/util/net/Constants.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/Constants.java (rev 0)
+++ trunk/java/org/apache/tomcat/util/net/Constants.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tomcat.util.net;
+
+/**
+ * Constants.
+ *
+ * @author Remy Maucherat
+ */
+public final class Constants {
+
+
+ public static final boolean WAIT_FOR_THREAD =
+ Boolean.valueOf(System.getProperty("org.apache.tomcat.util.net.WAIT_FOR_THREAD", "false")).booleanValue();
+
+ /**
+ * The Request attribute key for the cipher suite.
+ */
+ public static final String CIPHER_SUITE_KEY = "javax.servlet.request.cipher_suite";
+
+ /**
+ * The Request attribute key for the key size.
+ */
+ public static final String KEY_SIZE_KEY = "javax.servlet.request.key_size";
+
+ /**
+ * The Request attribute key for the client certificate chain.
+ */
+ public static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
+
+ /**
+ * The Request attribute key for the session id.
+ * This one is a Tomcat extension to the Servlet spec.
+ */
+ public static final String SESSION_ID_KEY = "javax.servlet.request.ssl_session";
+
+
+}
Modified: trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java 2011-10-21 10:17:39 UTC (rev 1854)
@@ -60,28 +60,6 @@
StringManager.getManager("org.apache.tomcat.util.net.res");
- /**
- * The Request attribute key for the cipher suite.
- */
- public static final String CIPHER_SUITE_KEY = "javax.servlet.request.cipher_suite";
-
- /**
- * The Request attribute key for the key size.
- */
- public static final String KEY_SIZE_KEY = "javax.servlet.request.key_size";
-
- /**
- * The Request attribute key for the client certificate chain.
- */
- public static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
-
- /**
- * The Request attribute key for the session id.
- * This one is a Tomcat extension to the Servlet spec.
- */
- public static final String SESSION_ID_KEY = "javax.servlet.request.ssl_session";
-
-
// ----------------------------------------------------------------- Fields
@@ -1211,7 +1189,8 @@
protected Worker getWorkerThread() {
// Allocate a new worker thread
Worker workerThread = createWorkerThread();
- if (org.apache.tomcat.util.Constants.LOW_MEMORY) {
+ if (org.apache.tomcat.util.net.Constants.WAIT_FOR_THREAD
+ || org.apache.tomcat.util.Constants.LOW_MEMORY) {
while (workerThread == null) {
try {
synchronized (workers) {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-10-20 17:40:18 UTC (rev 1853)
+++ trunk/webapps/docs/changelog.xml 2011-10-21 10:17:39 UTC (rev 1854)
@@ -22,8 +22,22 @@
<fix>
Improve DIGEST authentication security. (remm)
</fix>
+ <fix>
+ <jira>AS7-2073</jira>: Delegate connector lifecycle handling if in delay mode. (jfclere, remm)
+ </fix>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Possible exception parsing invalid chunk headers. (remm)
+ </fix>
+ <fix>
+ Add org.apache.tomcat.util.net.WAIT_FOR_THREAD system property to bring back optional
+ blocking for the thread pool. (remm)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 7.0.2.Final (remm)">
13 years, 2 months
JBossWeb SVN: r1853 - trunk/java/org/apache/coyote/http11/filters.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-20 13:40:18 -0400 (Thu, 20 Oct 2011)
New Revision: 1853
Modified:
trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
Avoid possible exception parsing chunk header.
Modified: trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
--- trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2011-10-17 13:30:25 UTC (rev 1852)
+++ trunk/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2011-10-20 17:40:18 UTC (rev 1853)
@@ -286,6 +286,8 @@
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
+ } else if (buf[pos] < 0) {
+ throw new IOException("Invalid chunk header");
} else if (!trailer) {
//don't read data after the trailer
if (HexUtils.DEC[buf[pos]] != -1) {
13 years, 2 months
JBossWeb SVN: r1852 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2011-10-17 09:30:25 -0400 (Mon, 17 Oct 2011)
New Revision: 1852
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/coyote/http11/Http11Protocol.java
Log:
- Allow (basic) configuration of keepalive using a system property. It should not be needed in most cases.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2011-10-12 15:26:42 UTC (rev 1851)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2011-10-17 13:30:25 UTC (rev 1852)
@@ -379,7 +379,7 @@
* Maximum number of requests which can be performed over a keepalive
* connection. The default is the same as for Apache HTTP Server.
*/
- protected int maxKeepAliveRequests = 100;
+ protected int maxKeepAliveRequests = Integer.valueOf(System.getProperty("org.apache.coyote.http11.Http11Protocol.MAX_KEEP_ALIVE_REQUESTS", "100")).intValue();
public int getMaxKeepAliveRequests() { return maxKeepAliveRequests; }
public void setMaxKeepAliveRequests(int mkar) { maxKeepAliveRequests = mkar; }
Modified: trunk/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Protocol.java 2011-10-12 15:26:42 UTC (rev 1851)
+++ trunk/java/org/apache/coyote/http11/Http11Protocol.java 2011-10-17 13:30:25 UTC (rev 1852)
@@ -335,7 +335,8 @@
* Maximum number of requests which can be performed over a keepalive
* connection. The default is the same as for Apache HTTP Server.
*/
- protected int maxKeepAliveRequests = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 1 : 100;
+ protected int maxKeepAliveRequests = (org.apache.tomcat.util.Constants.LOW_MEMORY) ? 1 :
+ Integer.valueOf(System.getProperty("org.apache.coyote.http11.Http11Protocol.MAX_KEEP_ALIVE_REQUESTS", "100")).intValue();
public int getMaxKeepAliveRequests() { return maxKeepAliveRequests; }
public void setMaxKeepAliveRequests(int mkar) { maxKeepAliveRequests = mkar; }
13 years, 2 months