JBossWeb SVN: r1919 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2012-01-12 06:27:47 -0500 (Thu, 12 Jan 2012)
New Revision: 1919
Modified:
trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
trunk/webapps/docs/changelog.xml
Log:
JBWEB-221: Add leftovers to the char encoder.
Modified: trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/C2BConverter.java 2012-01-10 08:46:41 UTC (rev 1918)
+++ trunk/java/org/apache/tomcat/util/buf/C2BConverter.java 2012-01-12 11:27:47 UTC (rev 1919)
@@ -41,6 +41,11 @@
protected CharBuffer cb = null;
/**
+ * Leftover buffer used for multi-characters characters.
+ */
+ protected CharBuffer leftovers = null;
+
+ /**
* Create an encoder for the specified charset.
*/
public C2BConverter(String charset)
@@ -51,6 +56,8 @@
} catch (UnsupportedCharsetException e) {
throw new UnsupportedEncodingException(charset);
}
+ char[] left = new char[4];
+ leftovers = CharBuffer.wrap(left);
}
/**
@@ -58,8 +65,13 @@
*/
public void recycle() {
encoder.reset();
+ leftovers.position(0);
}
+ public boolean isUndeflow() {
+ return (leftovers.position() > 0);
+ }
+
/**
* Convert the given characters to bytes.
*
@@ -86,8 +98,26 @@
cb.limit(cc.getEnd());
cb.position(cc.getStart());
}
+ CoderResult result = null;
+ // Parse leftover if any are present
+ if (leftovers.position() > 0) {
+ int pos = bb.position();
+ // Loop until one char is encoded or there is a encoder error
+ do {
+ leftovers.put((char) cc.substract());
+ leftovers.flip();
+ result = encoder.encode(leftovers, bb, false);
+ leftovers.position(leftovers.limit());
+ leftovers.limit(leftovers.array().length);
+ } while (result.isUnderflow() && (bb.position() == pos));
+ if (result.isError() || result.isMalformed()) {
+ result.throwException();
+ }
+ cb.position(cc.getStart());
+ leftovers.position(0);
+ }
// Do the decoding and get the results into the byte chunk and the char chunk
- CoderResult result = encoder.encode(cb, bb, false);
+ result = encoder.encode(cb, bb, false);
if (result.isError() || result.isMalformed()) {
result.throwException();
} else if (result.isOverflow()) {
@@ -98,6 +128,12 @@
// Propagate current positions to the byte chunk and char chunk
bc.setEnd(bb.position());
cc.setOffset(cb.position());
+ // Put leftovers in the leftovers char buffer
+ if (cc.getLength() > 0) {
+ leftovers.limit(leftovers.array().length);
+ leftovers.position(cc.getLength());
+ cc.substract(leftovers.array(), 0, cc.getLength());
+ }
}
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2012-01-10 08:46:41 UTC (rev 1918)
+++ trunk/webapps/docs/changelog.xml 2012-01-12 11:27:47 UTC (rev 1919)
@@ -16,6 +16,17 @@
<body>
+<section name="JBoss Web 7.0.9.Final (remm)">
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ <jira>221</jira>: Add leftovers to the character encoder to accomodate
+ multi-chars characters. (remm)
+ </fix>
+ </changelog>
+ </subsection>
+</section>
+
<section name="JBoss Web 7.0.8.Final (remm)">
<subsection name="Catalina">
<changelog>
12 years, 11 months
JBossWeb SVN: r1918 - branches/2.1.x/webapps/docs.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2012-01-10 03:46:41 -0500 (Tue, 10 Jan 2012)
New Revision: 1918
Modified:
branches/2.1.x/webapps/docs/ssl-howto.xml
Log:
Remove the Http11NioProtocol that we don't support.
Modified: branches/2.1.x/webapps/docs/ssl-howto.xml
===================================================================
--- branches/2.1.x/webapps/docs/ssl-howto.xml 2012-01-10 08:43:49 UTC (rev 1917)
+++ branches/2.1.x/webapps/docs/ssl-howto.xml 2012-01-10 08:46:41 UTC (rev 1918)
@@ -339,16 +339,6 @@
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
-->
-<-- Define a non-blocking Java SSL Coyote HTTP/1.1 Connector on port 8443 -->
-<!--
-<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
- port="8443" minSpareThreads="5" maxSpareThreads="75"
- enableLookups="true" disableUploadTimeout="true"
- acceptCount="100" maxThreads="200"
- scheme="https" secure="true" SSLEnabled="true"
- keystoreFile="${user.home}/.keystore" keystorePass="changeit"
- clientAuth="false" sslProtocol="TLS"/>
--->
</source>
and to specify an APR connector
<source>
12 years, 12 months
JBossWeb SVN: r1917 - branches/3.0.x/webapps/docs.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2012-01-10 03:43:49 -0500 (Tue, 10 Jan 2012)
New Revision: 1917
Modified:
branches/3.0.x/webapps/docs/ssl-howto.xml
Log:
Remove the Http11NioProtocol that we don't support.
Modified: branches/3.0.x/webapps/docs/ssl-howto.xml
===================================================================
--- branches/3.0.x/webapps/docs/ssl-howto.xml 2012-01-09 16:34:41 UTC (rev 1916)
+++ branches/3.0.x/webapps/docs/ssl-howto.xml 2012-01-10 08:43:49 UTC (rev 1917)
@@ -339,16 +339,6 @@
keystoreFile="${user.home}/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>
-->
-<-- Define a non-blocking Java SSL Coyote HTTP/1.1 Connector on port 8443 -->
-<!--
-<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
- port="8443" minSpareThreads="5" maxSpareThreads="75"
- enableLookups="true" disableUploadTimeout="true"
- acceptCount="100" maxThreads="200"
- scheme="https" secure="true" SSLEnabled="true"
- keystoreFile="${user.home}/.keystore" keystorePass="changeit"
- clientAuth="false" sslProtocol="TLS"/>
--->
</source>
and to specify an APR connector
<source>
12 years, 12 months
JBossWeb SVN: r1916 - branches.
by jbossweb-commits@lists.jboss.org
Author: bmaxwell
Date: 2012-01-09 11:34:41 -0500 (Mon, 09 Jan 2012)
New Revision: 1916
Added:
branches/JBOSSWEB_2_0_0_GA_CP16_JBPAPP-7862/
Log:
[JBPAPP-7862] one off patch branch
12 years, 12 months
JBossWeb SVN: r1915 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2012-01-06 09:56:23 -0500 (Fri, 06 Jan 2012)
New Revision: 1915
Added:
tags/JBOSSWEB_7_0_8_FINAL/
Log:
Web 7.0.8.
12 years, 12 months
JBossWeb SVN: r1914 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2012-01-06 05:24:41 -0500 (Fri, 06 Jan 2012)
New Revision: 1914
Modified:
trunk/java/org/apache/naming/resources/ProxyDirContext.java
trunk/java/org/apache/naming/resources/ResourceCache.java
trunk/webapps/docs/changelog.xml
Log:
With the low memory flag enabled, it could be possible the not found entry gets bigger than the cache size,
causing problems, so use a better default.
Modified: trunk/java/org/apache/naming/resources/ProxyDirContext.java
===================================================================
--- trunk/java/org/apache/naming/resources/ProxyDirContext.java 2012-01-05 16:10:52 UTC (rev 1913)
+++ trunk/java/org/apache/naming/resources/ProxyDirContext.java 2012-01-06 10:24:41 UTC (rev 1914)
@@ -73,8 +73,6 @@
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import org.apache.naming.NamingContextBindingsEnumeration;
-import org.apache.naming.NamingContextEnumeration;
import org.apache.naming.NamingEnumerationImpl;
import org.apache.naming.StringManager;
@@ -122,6 +120,7 @@
cache = new ResourceCache();
}
cache.setCacheMaxSize(baseDirContext.getCacheMaxSize());
+ cache.setSpareNotFoundEntries(baseDirContext.getCacheMaxSize()/8);
cacheTTL = baseDirContext.getCacheTTL();
cacheObjectMaxSize = baseDirContext.getCacheObjectMaxSize();
// cacheObjectMaxSize must be less than cacheMaxSize
Modified: trunk/java/org/apache/naming/resources/ResourceCache.java
===================================================================
--- trunk/java/org/apache/naming/resources/ResourceCache.java 2012-01-05 16:10:52 UTC (rev 1913)
+++ trunk/java/org/apache/naming/resources/ResourceCache.java 2012-01-06 10:24:41 UTC (rev 1914)
@@ -210,7 +210,7 @@
// Increase the amount to free so that allocate won't have to run right
// away again
- toFree += (cacheMaxSize / 20);
+ toFree += (cacheMaxSize / 16);
int size = notFoundCache.size();
if (size > spareNotFoundEntries) {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2012-01-05 16:10:52 UTC (rev 1913)
+++ trunk/webapps/docs/changelog.xml 2012-01-06 10:24:41 UTC (rev 1914)
@@ -22,6 +22,9 @@
<fix>
Updates for Servlet 3.0a. (markt, remm)
</fix>
+ <fix>
+ Fix cache defaults with low memory mode. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
13 years
JBossWeb SVN: r1913 - in trunk: test/java/org/apache/el and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2012-01-05 11:10:52 -0500 (Thu, 05 Jan 2012)
New Revision: 1913
Modified:
trunk/java/org/apache/el/util/ReflectionUtil.java
trunk/test/java/org/apache/el/TestMethodExpressionImpl.java
trunk/webapps/docs/changelog.xml
Log:
AS7-3177: NPE mapping null parameters values in EL
Modified: trunk/java/org/apache/el/util/ReflectionUtil.java
===================================================================
--- trunk/java/org/apache/el/util/ReflectionUtil.java 2012-01-04 16:14:28 UTC (rev 1912)
+++ trunk/java/org/apache/el/util/ReflectionUtil.java 2012-01-05 16:10:52 UTC (rev 1913)
@@ -156,8 +156,7 @@
int exactMatch = 0;
boolean noMatch = false;
for (int i = 0; i < mParamCount; i++) {
- // Can't be null
- if (mParamTypes[i].equals(paramTypes[i])) {
+ if (paramTypes[i] == null || mParamTypes[i].equals(paramTypes[i])) {
exactMatch++;
} else if (i == (mParamCount - 1) && m.isVarArgs()) {
Class<?> varType = mParamTypes[i].getComponentType();
Modified: trunk/test/java/org/apache/el/TestMethodExpressionImpl.java
===================================================================
--- trunk/test/java/org/apache/el/TestMethodExpressionImpl.java 2012-01-04 16:14:28 UTC (rev 1912)
+++ trunk/test/java/org/apache/el/TestMethodExpressionImpl.java 2012-01-05 16:10:52 UTC (rev 1913)
@@ -156,6 +156,20 @@
}
@Test
+ public void testInvokeAS7_3177() {
+ TesterBeanB beanB = new TesterBeanB();
+ beanB.setName("B");
+
+ context.getVariableMapper().setVariable("arg",
+ factory.createValueExpression(null, Object.class));
+
+ MethodExpression me1 = factory.createMethodExpression(
+ context, "${beanB.sayHello(arg)}", String.class,
+ null);
+ assertEquals("Hello null from B", me1.invoke(context, null));
+ }
+
+ @Test
public void testInvokeWithSuper() {
MethodExpression me = factory.createMethodExpression(context,
"${beanA.setBean(beanBB)}", null ,
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2012-01-04 16:14:28 UTC (rev 1912)
+++ trunk/webapps/docs/changelog.xml 2012-01-05 16:10:52 UTC (rev 1913)
@@ -24,6 +24,16 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <jira>211</jira>: Better exception handling when validating EL. (remm)
+ </fix>
+ <fix>
+ <jboss-jira>AS7-3177</jboss-jira>: NPE mapping null parameters values in EL. (remm)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 7.0.7.Final (remm)">
13 years
JBossWeb SVN: r1912 - in branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837: java/org/apache/tomcat/util/http and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: bmaxwell
Date: 2012-01-04 11:14:28 -0500 (Wed, 04 Jan 2012)
New Revision: 1912
Modified:
branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.properties.default
branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.xml
branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/MimeHeaders.java
branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/Parameters.java
Log:
[JBPAPP-7837] JBWEB-209: CVE Fixes: 2011-2204, 2011-2729, 2011-1184, 2011-2526, 2011-4858
Modified: branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.properties.default
===================================================================
--- branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.properties.default 2012-01-04 16:13:17 UTC (rev 1911)
+++ branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.properties.default 2012-01-04 16:14:28 UTC (rev 1912)
@@ -12,8 +12,8 @@
# ----- Version Control Flags -----
version.major=2
version.minor=1
-version.build=4
-version.patch=0
+version.build=11
+version.patch=JBPAPP-7837
version.tag=SNAPSHOT
# ----- Default Base Path for Dependent Packages -----
Modified: branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.xml
===================================================================
--- branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.xml 2012-01-04 16:13:17 UTC (rev 1911)
+++ branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/build.xml 2012-01-04 16:14:28 UTC (rev 1912)
@@ -17,7 +17,7 @@
<property name="version.major" value="2" />
<property name="version.minor" value="1" />
<property name="version.build" value="0" />
- <property name="version.patch" value="0" />
+ <property name="version.patch" value="JBPAPP-7837" />
<property name="version.tag" value="SNAPSHOT" />
<property name="version" value="${version.major}.${version.minor}.${version.build}.${version.tag}" />
<property name="version.number" value="${version.major}.${version.minor}.${version.build}.${version.patch}" />
Modified: branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/MimeHeaders.java
===================================================================
--- branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/MimeHeaders.java 2012-01-04 16:13:17 UTC (rev 1911)
+++ branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/MimeHeaders.java 2012-01-04 16:14:28 UTC (rev 1912)
@@ -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: branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/Parameters.java
===================================================================
--- branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/Parameters.java 2012-01-04 16:13:17 UTC (rev 1911)
+++ branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/java/org/apache/tomcat/util/http/Parameters.java 2012-01-04 16:14:28 UTC (rev 1912)
@@ -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);
13 years
JBossWeb SVN: r1911 - in branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836: src/share/classes/org/apache/tomcat/util/http and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: bmaxwell
Date: 2012-01-04 11:13:17 -0500 (Wed, 04 Jan 2012)
New Revision: 1911
Modified:
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.properties.default
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.xml
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/MimeHeaders.java
branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/Parameters.java
Log:
[JBPAPP-7836] JBWEB-209: CVE Fixes: 2011-2204, 2011-2729, 2011-1184, 2011-2526, 2011-4858
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.properties.default
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.properties.default 2012-01-03 21:46:24 UTC (rev 1910)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.properties.default 2012-01-04 16:13:17 UTC (rev 1911)
@@ -13,7 +13,7 @@
version.major=2
version.minor=0
version.build=0
-version.patch=GA_CP
+version.patch=GA_CP15_JBPAPP-7836
# ----- Vesion Control Flags -----
jboss.version.major=4
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.xml
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.xml 2012-01-03 21:46:24 UTC (rev 1910)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/build.xml 2012-01-04 16:13:17 UTC (rev 1911)
@@ -16,7 +16,7 @@
<property name="version.major" value="2" />
<property name="version.minor" value="0" />
<property name="version.build" value="0" />
- <property name="version.patch" value="snapshot" />
+ <property name="version.patch" value="GA_CP15_JBPAPP-7836" />
<property name="version.flag" value="" />
<property name="version.number" value="${version.major}.${version.minor}.${version.build}.${version.patch}" />
<property name="version" value="${version.major}.${version.minor}.${version.build}.${version.patch}${version.flag}" />
Modified: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/MimeHeaders.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/MimeHeaders.java 2012-01-03 21:46:24 UTC (rev 1910)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/MimeHeaders.java 2012-01-04 16:13:17 UTC (rev 1911)
@@ -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
@@ -79,12 +76,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]
@@ -93,9 +84,11 @@
*/
public class MimeHeaders {
/** 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.
@@ -216,6 +209,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);
@@ -326,9 +322,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: branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/Parameters.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/Parameters.java 2012-01-03 21:46:24 UTC (rev 1910)
+++ branches/JBOSSWEB_2_0_0_GA_CP15_JBPAPP-7836/src/share/classes/org/apache/tomcat/util/http/Parameters.java 2012-01-04 16:13:17 UTC (rev 1911)
@@ -51,6 +51,8 @@
MessageBytes decodedQuery=MessageBytes.newInstance();
public static final int INITIAL_SIZE=4;
+ protected static final int MAX_COUNT =
+ Integer.valueOf(System.getProperty("org.apache.tomcat.util.http.Parameters.MAX_COUNT", "512")).intValue();
// Garbage-less parameter merging.
// In a sub-request with parameters, the new parameters
@@ -175,6 +177,8 @@
values[i+ oldValues.length] = newValues[i];
}
} else {
+ if (paramHashStringArray.size() >=MAX_COUNT)
+ throw new IllegalStateException("Parameter count exceeded allowed maximum: " + MAX_COUNT);
values = newValues;
}
@@ -316,6 +320,8 @@
}
values[oldValues.length] = value;
} else {
+ if (paramHashStringArray.size() >=MAX_COUNT)
+ throw new IllegalStateException("Parameter count exceeded allowed maximum: " + MAX_COUNT);
values = new String[1];
values[0] = value;
}
13 years
JBossWeb SVN: r1910 - branches.
by jbossweb-commits@lists.jboss.org
Author: bmaxwell
Date: 2012-01-03 16:46:24 -0500 (Tue, 03 Jan 2012)
New Revision: 1910
Added:
branches/JBOSSWEB_2_1_11_GA_JBPAPP-7837/
Log:
[JBPAPP-7837] one off patch branch
13 years