JBossWeb SVN: r2616 - in branches: JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219 and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-30 10:13:48 -0400 (Thu, 30 Apr 2015)
New Revision: 2616
Added:
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/
Modified:
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
JBPAPP-11219 create one-off patch branch
Property changes on: branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219
___________________________________________________________________
Added: svn:ignore
+ .settings
output
build.properties
Added: svn:mergeinfo
+ /branches/2.1.x:2609
Modified: branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
--- tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-30 13:48:00 UTC (rev 2615)
+++ branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-30 14:13:48 UTC (rev 2616)
@@ -101,6 +101,11 @@
*/
protected boolean needCRLFParse = false;
+ /**
+ * Flag that indicates if an error has occurred.
+ */
+ private boolean error;
+
// ------------------------------------------------------------- Properties
@@ -122,6 +127,8 @@
if (endChunk)
return -1;
+ checkError();
+
if (needCRLFParse) {
needCRLFParse = false;
// FIXME: parse CRLF could return 0 in NB
@@ -221,6 +228,7 @@
lastValid = 0;
endChunk = false;
needCRLFParse = false;
+ error = false;
}
@@ -275,6 +283,7 @@
// In non blocking mode, no new chunk follows, even if data was present
int n = readBytes();
if (n < 0) {
+ error = true;
throw new IOException("Invalid chunk header");
} else if (n == 0) {
return false;
@@ -286,6 +295,9 @@
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
+ } else if (buf[pos] < 0) {
+ error = true;
+ throw new IOException("Invalid chunk header");
} else if (!trailer) {
//don't read data after the trailer
if (HexUtils.DEC[buf[pos]] != -1) {
@@ -295,6 +307,7 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
+ error = true;
throw new IOException("Invalid chunk header");
}
}
@@ -303,8 +316,10 @@
}
- if (!readDigit || (result < 0))
+ if (readDigit == 0 || (result < 0)) {
+ error = true;
throw new IOException("Invalid chunk header");
+ }
if (result == 0)
endChunk = true;
@@ -328,17 +343,26 @@
while (!eol) {
if (pos >= lastValid) {
- if (readBytes() <= 0)
+ if (readBytes() <= 0) {
+ error = true;
throw new IOException("Invalid CRLF");
+ }
}
if (buf[pos] == Constants.CR) {
- if (crfound) throw new IOException("Invalid CRLF, two CR characters encountered.");
+ if (crfound) {
+ error = true;
+ throw new IOException("Invalid CRLF, two CR characters encountered.");
+ }
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) throw new IOException("Invalid CRLF, no CR character encountered.");
+ if (!crfound) {
+ error = true;
+ throw new IOException("Invalid CRLF, no CR character encountered.");
+ }
eol = true;
} else {
+ error = true;
throw new IOException("Invalid CRLF");
}
@@ -362,5 +386,11 @@
}
+
+ private void checkError() throws IOException {
+ if (error) {
+ throw new IOException("Chunked input filter error");
+ }
+ }
}
9 years, 8 months
JBossWeb SVN: r2615 - in tags/JBOSSWEB_2_1_12_GA_patch03: java/org/apache/coyote/http11/filters and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-30 09:48:00 -0400 (Thu, 30 Apr 2015)
New Revision: 2615
Modified:
tags/JBOSSWEB_2_1_12_GA_patch03/
tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
Reverse merging 2610 from the release tag.
Property changes on: tags/JBOSSWEB_2_1_12_GA_patch03
___________________________________________________________________
Deleted: svn:mergeinfo
- /branches/2.1.x:2609
Modified: tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
--- tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-30 13:31:09 UTC (rev 2614)
+++ tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-30 13:48:00 UTC (rev 2615)
@@ -101,11 +101,6 @@
*/
protected boolean needCRLFParse = false;
- /**
- * Flag that indicates if an error has occurred.
- */
- private boolean error;
-
// ------------------------------------------------------------- Properties
@@ -127,8 +122,6 @@
if (endChunk)
return -1;
- checkError();
-
if (needCRLFParse) {
needCRLFParse = false;
// FIXME: parse CRLF could return 0 in NB
@@ -228,7 +221,6 @@
lastValid = 0;
endChunk = false;
needCRLFParse = false;
- error = false;
}
@@ -283,7 +275,6 @@
// In non blocking mode, no new chunk follows, even if data was present
int n = readBytes();
if (n < 0) {
- error = true;
throw new IOException("Invalid chunk header");
} else if (n == 0) {
return false;
@@ -295,9 +286,6 @@
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
- } else if (buf[pos] < 0) {
- error = true;
- throw new IOException("Invalid chunk header");
} else if (!trailer) {
//don't read data after the trailer
if (HexUtils.DEC[buf[pos]] != -1) {
@@ -307,7 +295,6 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
- error = true;
throw new IOException("Invalid chunk header");
}
}
@@ -316,10 +303,8 @@
}
- if (readDigit == 0 || (result < 0)) {
- error = true;
+ if (!readDigit || (result < 0))
throw new IOException("Invalid chunk header");
- }
if (result == 0)
endChunk = true;
@@ -343,26 +328,17 @@
while (!eol) {
if (pos >= lastValid) {
- if (readBytes() <= 0) {
- error = true;
+ if (readBytes() <= 0)
throw new IOException("Invalid CRLF");
- }
}
if (buf[pos] == Constants.CR) {
- if (crfound) {
- error = true;
- throw new IOException("Invalid CRLF, two CR characters encountered.");
- }
+ if (crfound) throw new IOException("Invalid CRLF, two CR characters encountered.");
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) {
- error = true;
- throw new IOException("Invalid CRLF, no CR character encountered.");
- }
+ if (!crfound) throw new IOException("Invalid CRLF, no CR character encountered.");
eol = true;
} else {
- error = true;
throw new IOException("Invalid CRLF");
}
@@ -386,11 +362,5 @@
}
-
- private void checkError() throws IOException {
- if (error) {
- throw new IOException("Chunked input filter error");
- }
- }
}
9 years, 8 months
JBossWeb SVN: r2614 - branches.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-30 09:31:09 -0400 (Thu, 30 Apr 2015)
New Revision: 2614
Removed:
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/
Log:
removing my bad branch
9 years, 8 months
JBossWeb SVN: r2613 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2015-04-30 08:44:20 -0400 (Thu, 30 Apr 2015)
New Revision: 2613
Added:
tags/JBOSSWEB_7_5_9_FINAL/
Log:
7.5.9 build
9 years, 8 months
JBossWeb SVN: r2612 - branches/7.5.x.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2015-04-30 08:43:52 -0400 (Thu, 30 Apr 2015)
New Revision: 2612
Modified:
branches/7.5.x/pom.xml
Log:
7.5.9 build
Modified: branches/7.5.x/pom.xml
===================================================================
--- branches/7.5.x/pom.xml 2015-04-30 01:44:29 UTC (rev 2611)
+++ branches/7.5.x/pom.xml 2015-04-30 12:43:52 UTC (rev 2612)
@@ -33,7 +33,7 @@
<groupId>org.jboss.web</groupId>
<artifactId>jbossweb</artifactId>
- <version>7.5.8.Final</version>
+ <version>7.5.9.Final</version>
<name>JBoss Web</name>
<description>Servlet 3.0 container</description>
9 years, 8 months
JBossWeb SVN: r2611 - in branches: JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-29 21:44:29 -0400 (Wed, 29 Apr 2015)
New Revision: 2611
Added:
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/
Modified:
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/InstanceManager.java
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/catalina/deploy/InjectionTarget.java
branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/jasper/runtime/InstanceManagerFactory.java
Log:
[JBPAPP-11219] create one-off patch branch
Modified: branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/InstanceManager.java
===================================================================
--- tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/InstanceManager.java 2015-04-29 18:17:42 UTC (rev 2610)
+++ branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/InstanceManager.java 2015-04-30 01:44:29 UTC (rev 2611)
@@ -25,7 +25,7 @@
import javax.naming.NamingException;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public interface InstanceManager {
Modified: branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/catalina/deploy/InjectionTarget.java
===================================================================
--- tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/catalina/deploy/InjectionTarget.java 2015-04-29 18:17:42 UTC (rev 2610)
+++ branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/catalina/deploy/InjectionTarget.java 2015-04-30 01:44:29 UTC (rev 2611)
@@ -21,7 +21,7 @@
package org.apache.catalina.deploy;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class InjectionTarget {
private String targetClass;
Modified: branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/jasper/runtime/InstanceManagerFactory.java
===================================================================
--- tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/jasper/runtime/InstanceManagerFactory.java 2015-04-29 18:17:42 UTC (rev 2610)
+++ branches/JBOSSWEB_2_1_12_GA_patch03_JBPAPP-11219/java/org/apache/jasper/runtime/InstanceManagerFactory.java 2015-04-30 01:44:29 UTC (rev 2611)
@@ -25,7 +25,7 @@
import org.apache.InstanceManager;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class InstanceManagerFactory {
9 years, 8 months
JBossWeb SVN: r2610 - in tags/JBOSSWEB_2_1_12_GA_patch03: java/org/apache/coyote/http11/filters and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-29 14:17:42 -0400 (Wed, 29 Apr 2015)
New Revision: 2610
Modified:
tags/JBOSSWEB_2_1_12_GA_patch03/
tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
[JBPAPP-11219] create one-off patch branch
Property changes on: tags/JBOSSWEB_2_1_12_GA_patch03
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/2.1.x:2609
Modified: tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
--- tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-29 18:10:42 UTC (rev 2609)
+++ tags/JBOSSWEB_2_1_12_GA_patch03/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-29 18:17:42 UTC (rev 2610)
@@ -101,6 +101,11 @@
*/
protected boolean needCRLFParse = false;
+ /**
+ * Flag that indicates if an error has occurred.
+ */
+ private boolean error;
+
// ------------------------------------------------------------- Properties
@@ -122,6 +127,8 @@
if (endChunk)
return -1;
+ checkError();
+
if (needCRLFParse) {
needCRLFParse = false;
// FIXME: parse CRLF could return 0 in NB
@@ -221,6 +228,7 @@
lastValid = 0;
endChunk = false;
needCRLFParse = false;
+ error = false;
}
@@ -275,6 +283,7 @@
// In non blocking mode, no new chunk follows, even if data was present
int n = readBytes();
if (n < 0) {
+ error = true;
throw new IOException("Invalid chunk header");
} else if (n == 0) {
return false;
@@ -286,6 +295,9 @@
eol = true;
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
+ } else if (buf[pos] < 0) {
+ error = true;
+ throw new IOException("Invalid chunk header");
} else if (!trailer) {
//don't read data after the trailer
if (HexUtils.DEC[buf[pos]] != -1) {
@@ -295,6 +307,7 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
+ error = true;
throw new IOException("Invalid chunk header");
}
}
@@ -303,8 +316,10 @@
}
- if (!readDigit || (result < 0))
+ if (readDigit == 0 || (result < 0)) {
+ error = true;
throw new IOException("Invalid chunk header");
+ }
if (result == 0)
endChunk = true;
@@ -328,17 +343,26 @@
while (!eol) {
if (pos >= lastValid) {
- if (readBytes() <= 0)
+ if (readBytes() <= 0) {
+ error = true;
throw new IOException("Invalid CRLF");
+ }
}
if (buf[pos] == Constants.CR) {
- if (crfound) throw new IOException("Invalid CRLF, two CR characters encountered.");
+ if (crfound) {
+ error = true;
+ throw new IOException("Invalid CRLF, two CR characters encountered.");
+ }
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) throw new IOException("Invalid CRLF, no CR character encountered.");
+ if (!crfound) {
+ error = true;
+ throw new IOException("Invalid CRLF, no CR character encountered.");
+ }
eol = true;
} else {
+ error = true;
throw new IOException("Invalid CRLF");
}
@@ -362,5 +386,11 @@
}
+
+ private void checkError() throws IOException {
+ if (error) {
+ throw new IOException("Chunked input filter error");
+ }
+ }
}
9 years, 8 months
JBossWeb SVN: r2609 - branches/2.1.x/java/org/apache/coyote/http11/filters.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-29 14:10:42 -0400 (Wed, 29 Apr 2015)
New Revision: 2609
Modified:
branches/2.1.x/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
Log:
CVE-2014-0227 backport
Modified: branches/2.1.x/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
===================================================================
--- branches/2.1.x/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-23 13:24:45 UTC (rev 2608)
+++ branches/2.1.x/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2015-04-29 18:10:42 UTC (rev 2609)
@@ -101,6 +101,11 @@
*/
protected boolean needCRLFParse = false;
+ /**
+ * Flag that indicates if an error has occurred.
+ */
+ private boolean error;
+
// ------------------------------------------------------------- Properties
@@ -122,6 +127,8 @@
if (endChunk)
return -1;
+ checkError();
+
if (needCRLFParse) {
needCRLFParse = false;
// FIXME: parse CRLF could return 0 in NB
@@ -221,6 +228,7 @@
lastValid = 0;
endChunk = false;
needCRLFParse = false;
+ error = false;
}
@@ -276,6 +284,7 @@
// In non blocking mode, no new chunk follows, even if data was present
int n = readBytes();
if (n < 0) {
+ error = true;
throw new IOException("Invalid chunk header");
} else if (n == 0) {
return false;
@@ -291,6 +300,7 @@
} else if (buf[pos] == Constants.SEMI_COLON) {
trailer = true;
} else if (buf[pos] < 0) {
+ error = true;
throw new IOException("Invalid chunk header");
} else if (!trailer) {
//don't read data after the trailer
@@ -301,6 +311,7 @@
} else {
//we shouldn't allow invalid, non hex characters
//in the chunked header
+ error = true;
throw new IOException("Invalid chunk header");
}
}
@@ -309,8 +320,10 @@
}
- if (readDigit == 0 || (result < 0))
+ if (readDigit == 0 || (result < 0)) {
+ error = true;
throw new IOException("Invalid chunk header");
+ }
if (result == 0)
endChunk = true;
@@ -334,17 +347,26 @@
while (!eol) {
if (pos >= lastValid) {
- if (readBytes() <= 0)
+ if (readBytes() <= 0) {
+ error = true;
throw new IOException("Invalid CRLF");
+ }
}
if (buf[pos] == Constants.CR) {
- if (crfound) throw new IOException("Invalid CRLF, two CR characters encountered.");
+ if (crfound) {
+ error = true;
+ throw new IOException("Invalid CRLF, two CR characters encountered.");
+ }
crfound = true;
} else if (buf[pos] == Constants.LF) {
- if (!crfound) throw new IOException("Invalid CRLF, no CR character encountered.");
+ if (!crfound) {
+ error = true;
+ throw new IOException("Invalid CRLF, no CR character encountered.");
+ }
eol = true;
} else {
+ error = true;
throw new IOException("Invalid CRLF");
}
@@ -368,5 +390,11 @@
}
+
+ private void checkError() throws IOException {
+ if (error) {
+ throw new IOException("Chunked input filter error");
+ }
+ }
}
9 years, 8 months
JBossWeb SVN: r2608 - in branches/7.5.x/src/main/java/org/apache/catalina: core and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2015-04-23 09:24:45 -0400 (Thu, 23 Apr 2015)
New Revision: 2608
Modified:
branches/7.5.x/src/main/java/org/apache/catalina/Wrapper.java
branches/7.5.x/src/main/java/org/apache/catalina/core/ApplicationContext.java
branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapper.java
branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapperFacade.java
Log:
BZ1196513: Add patch to allow overriding servlets. Submitted by James Livingston.
Modified: branches/7.5.x/src/main/java/org/apache/catalina/Wrapper.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/Wrapper.java 2015-04-17 00:34:57 UTC (rev 2607)
+++ branches/7.5.x/src/main/java/org/apache/catalina/Wrapper.java 2015-04-23 13:24:45 UTC (rev 2608)
@@ -440,4 +440,14 @@
*/
public ServletSecurityElement getServletSecurity();
+ /**
+ * Is the Servlet overridable by a ServletContainerInitializer?
+ */
+ public boolean isOverridable();
+
+ /**
+ * Sets the overridable attribute for this Servlet.
+ */
+ public void setOverridable(boolean overridable);
+
}
Modified: branches/7.5.x/src/main/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/core/ApplicationContext.java 2015-04-17 00:34:57 UTC (rev 2607)
+++ branches/7.5.x/src/main/java/org/apache/catalina/core/ApplicationContext.java 2015-04-23 13:24:45 UTC (rev 2608)
@@ -900,8 +900,13 @@
if (!context.isStarting()) {
throw MESSAGES.contextAlreadyInitialized(getContextPath());
}
- if (context.findChild(servletName) != null) {
- return null;
+ Wrapper existingWrapper = (Wrapper)context.findChild(servletName);
+ if (existingWrapper != null) {
+ if (existingWrapper.isOverridable()) {
+ existingWrapper.setOverridable(false);
+ } else {
+ return null;
+ }
}
Wrapper wrapper = context.createWrapper();
wrapper.setDynamic(true);
@@ -926,8 +931,13 @@
if (!context.isStarting()) {
throw MESSAGES.contextAlreadyInitialized(getContextPath());
}
- if (context.findChild(servletName) != null) {
- return null;
+ Wrapper existingWrapper = (Wrapper)context.findChild(servletName);
+ if (existingWrapper != null) {
+ if (existingWrapper.isOverridable()) {
+ existingWrapper.setOverridable(false);
+ } else {
+ return null;
+ }
}
// Servlet instance unicity
for (Container container : context.getParent().findChildren()) {
@@ -969,7 +979,7 @@
if (restricted) {
throw MESSAGES.restrictedListenerCannotCallMethod();
}
- Wrapper wrapper = (Wrapper) context.findChild(servletName);
+ Wrapper wrapper = (Wrapper)context.findChild(servletName);
if (wrapper != null) {
return wrapper.getFacade();
} else {
Modified: branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapper.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapper.java 2015-04-17 00:34:57 UTC (rev 2607)
+++ branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapper.java 2015-04-23 13:24:45 UTC (rev 2608)
@@ -113,7 +113,9 @@
*/
protected boolean dynamic = false;
+ private boolean overridable = false;
+
/**
* Enabled flag.
*/
@@ -311,7 +313,17 @@
// ------------------------------------------------------------- Properties
+
+ @Override
+ public boolean isOverridable() {
+ return overridable;
+ }
+ @Override
+ public void setOverridable(boolean overridable) {
+ this.overridable = overridable;
+ }
+
/**
* Return the async supported value.
*/
Modified: branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapperFacade.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapperFacade.java 2015-04-17 00:34:57 UTC (rev 2607)
+++ branches/7.5.x/src/main/java/org/apache/catalina/core/StandardWrapperFacade.java 2015-04-23 13:24:45 UTC (rev 2608)
@@ -38,6 +38,7 @@
import org.apache.catalina.Context;
import org.apache.catalina.deploy.Multipart;
+import org.apache.catalina.Wrapper;
/**
@@ -127,9 +128,18 @@
throw MESSAGES.invalidServletRegistrationArguments();
}
for (String urlPattern : urlPatterns) {
- if (((Context) wrapper.getParent()).findServletMapping(urlPattern) != null) {
- conflicts.add(urlPattern);
- }
+ Context context = ((Context) wrapper.getParent());
+ String wrapperName = context.findServletMapping(urlPattern);
+ if (wrapperName != null) {
+ Wrapper servletWrapper = (Wrapper) context.findChild(wrapperName);
+ if (servletWrapper.isOverridable()) {
+ // Some Wrappers (from global and host web.xml) may be
+ // overridden rather than generating a conflict
+ context.removeServletMapping(urlPattern);
+ } else {
+ conflicts.add(urlPattern);
+ }
+ }
}
if (conflicts.isEmpty()) {
for (String urlPattern : urlPatterns) {
9 years, 8 months
JBossWeb SVN: r2607 - in branches: JBOSSWEB_7_5_7_FINAL_BZ-1212566 and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: csutherl
Date: 2015-04-16 20:34:57 -0400 (Thu, 16 Apr 2015)
New Revision: 2607
Added:
branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/
Modified:
branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/
branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/main/java/org/apache/catalina/connector/OutputBuffer.java
branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/main/java/org/apache/tomcat/util/buf/ByteChunk.java
Log:
Merge: r2603 [JBWEB-312] Check if the output buffer can grow before flushing it when using a writer.
Property changes on: branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566
___________________________________________________________________
Added: svn:ignore
+ .settings
output
build.properties
target
Added: svn:mergeinfo
+ /branches/7.5.x:2603
Property changes on: branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/8.0.x/src:2529
+ /branches/7.5.x/src:2603
/branches/8.0.x/src:2529
Modified: branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/main/java/org/apache/catalina/connector/OutputBuffer.java
===================================================================
--- tags/JBOSSWEB_7_5_7_FINAL/src/main/java/org/apache/catalina/connector/OutputBuffer.java 2015-04-14 16:04:20 UTC (rev 2606)
+++ branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/main/java/org/apache/catalina/connector/OutputBuffer.java 2015-04-17 00:34:57 UTC (rev 2607)
@@ -512,7 +512,12 @@
break;
}
if (outputCharChunk.getLength() > 0) {
- bb.flushBuffer();
+ if (bb.getBuffer().length == bb.getEnd() && bb.getLength() < bb.getLimit()) {
+ // Need to expand output buffer
+ bb.makeSpace(outputCharChunk.getLength());
+ } else {
+ bb.flushBuffer();
+ }
}
}
Modified: branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/main/java/org/apache/tomcat/util/buf/ByteChunk.java
===================================================================
--- tags/JBOSSWEB_7_5_7_FINAL/src/main/java/org/apache/tomcat/util/buf/ByteChunk.java 2015-04-14 16:04:20 UTC (rev 2606)
+++ branches/JBOSSWEB_7_5_7_FINAL_BZ-1212566/src/main/java/org/apache/tomcat/util/buf/ByteChunk.java 2015-04-17 00:34:57 UTC (rev 2607)
@@ -451,11 +451,11 @@
end=start;
}
- /** Make space for len chars. If len is small, allocate
- * a reserve space too. Never grow bigger than limit.
+ /**
+ * Make space for len chars. If len is small, allocate a reserve space too.
+ * Never grow bigger than limit.
*/
- private void makeSpace(int count)
- {
+ public void makeSpace(int count) {
byte[] tmp = null;
int newSize;
9 years, 8 months