cxf git commit: [CXF-7058] Extra CDATA elements added on long CDATA payload Allow passing woodstox config to bypass the issue This closes #169
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes cd4e2423d -> 1630bf6c6 [CXF-7058] Extra CDATA elements added on long CDATA payload Allow passing woodstox config to bypass the issue This closes #169 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1630bf6c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1630bf6c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1630bf6c Branch: refs/heads/3.0.x-fixes Commit: 1630bf6c68028997da67ee37bae8f4cb46aa9546 Parents: cd4e242 Author: Rodrigo Merino Authored: Wed Sep 14 13:22:27 2016 -0300 Committer: Daniel Kulp Committed: Mon Apr 3 14:30:15 2017 -0400 -- .../org/apache/cxf/staxutils/StaxUtils.java | 23 +++- 1 file changed, 13 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1630bf6c/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java -- diff --git a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java index 3a8e5fa..00ad5ec 100644 --- a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java +++ b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java @@ -106,6 +106,8 @@ public final class StaxUtils { "org.apache.cxf.stax.maxAttributeSize"; public static final String MAX_TEXT_LENGTH = "org.apache.cxf.stax.maxTextLength"; +public static final String MIN_TEXT_SEGMENT = +"org.apache.cxf.stax.minTextSegment"; public static final String MAX_ELEMENT_COUNT = "org.apache.cxf.stax.maxElementCount"; public static final String MAX_XML_CHARACTERS = @@ -138,6 +140,7 @@ public final class StaxUtils { private static int maxAttributeCount = 500; private static int maxAttributeSize = 64 * 1024; //64K per attribute, likely just "list" will hit private static int maxTextLength = 128 * 1024 * 1024; //128M - more than this should DEFINITLEY use MTOM +private static int minTextSegment = 64; // Same default as woodstox private static long maxElementCount = Long.MAX_VALUE; private static long maxXMLCharacters = Long.MAX_VALUE; @@ -158,6 +161,7 @@ public final class StaxUtils { maxAttributeCount = getInteger(MAX_ATTRIBUTE_COUNT, maxAttributeCount); maxAttributeSize = getInteger(MAX_ATTRIBUTE_SIZE, maxAttributeSize); maxTextLength = getInteger(MAX_TEXT_LENGTH, maxTextLength); +minTextSegment = getInteger(MIN_TEXT_SEGMENT, minTextSegment); maxElementCount = getLong(MAX_ELEMENT_COUNT, maxElementCount); maxXMLCharacters = getLong(MAX_XML_CHARACTERS, maxXMLCharacters); @@ -361,16 +365,15 @@ public final class StaxUtils { private static boolean setRestrictionProperties(XMLInputFactory factory) { //For now, we can only support Woodstox 4.2.x and newer as none of the other //stax parsers support these settings -if (setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount) -&& setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize) -&& setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold) -&& setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount) -&& setProperty(factory, "com.ctc.wstx.maxElementDepth", innerElementLevelThreshold) -&& setProperty(factory, "com.ctc.wstx.maxCharacters", maxXMLCharacters) -&& setProperty(factory, "com.ctc.wstx.maxTextLength", maxTextLength)) { -return true; -} -return false; +final boolean wstxMaxs = setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount) +&& setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize) +&& setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold) +&& setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount) +&& setProperty(factory, "com.ctc.wstx.maxElementDepth", innerElementLevelThreshold) +&& setProperty(factory, "com.ctc.wstx.maxCharacters", maxXMLCharacters) +&& setProperty(factory, "com.ctc.wstx.maxTextLength", maxTextLength); +return wstxMaxs +&& setProperty(factory, "com.ctc.wstx.minTextSegment", minTextSegment); } private static boolean setProperty(XMLInputFactory f, String p, Object o) {
[2/2] cxf git commit: [CXF-7058] Extra CDATA elements added on long CDATA payload Allow passing woodstox config to bypass the issue This closes #169
[CXF-7058] Extra CDATA elements added on long CDATA payload Allow passing woodstox config to bypass the issue This closes #169 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1cb33324 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1cb33324 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1cb33324 Branch: refs/heads/3.1.x-fixes Commit: 1cb33324a5d2ab1a0308daa2fa4a38363b67be60 Parents: 4e78777 Author: Rodrigo Merino Authored: Wed Sep 14 13:22:27 2016 -0300 Committer: Daniel Kulp Committed: Mon Sep 19 11:03:36 2016 -0400 -- .../org/apache/cxf/staxutils/StaxUtils.java | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1cb33324/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java -- diff --git a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java index 4af5ddf..eb68092 100644 --- a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java +++ b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java @@ -107,6 +107,8 @@ public final class StaxUtils { "org.apache.cxf.stax.maxAttributeSize"; public static final String MAX_TEXT_LENGTH = "org.apache.cxf.stax.maxTextLength"; +public static final String MIN_TEXT_SEGMENT = +"org.apache.cxf.stax.minTextSegment"; public static final String MAX_ELEMENT_COUNT = "org.apache.cxf.stax.maxElementCount"; public static final String MAX_XML_CHARACTERS = @@ -139,6 +141,7 @@ public final class StaxUtils { private static int maxAttributeCount = 500; private static int maxAttributeSize = 64 * 1024; //64K per attribute, likely just "list" will hit private static int maxTextLength = 128 * 1024 * 1024; //128M - more than this should DEFINITLEY use MTOM +private static int minTextSegment = 64; // Same default as woodstox private static long maxElementCount = Long.MAX_VALUE; private static long maxXMLCharacters = Long.MAX_VALUE; @@ -159,6 +162,7 @@ public final class StaxUtils { maxAttributeCount = getInteger(MAX_ATTRIBUTE_COUNT, maxAttributeCount); maxAttributeSize = getInteger(MAX_ATTRIBUTE_SIZE, maxAttributeSize); maxTextLength = getInteger(MAX_TEXT_LENGTH, maxTextLength); +minTextSegment = getInteger(MIN_TEXT_SEGMENT, minTextSegment); maxElementCount = getLong(MAX_ELEMENT_COUNT, maxElementCount); maxXMLCharacters = getLong(MAX_XML_CHARACTERS, maxXMLCharacters); @@ -361,13 +365,15 @@ public final class StaxUtils { private static boolean setRestrictionProperties(XMLInputFactory factory) { //For now, we can only support Woodstox 4.2.x and newer as none of the other //stax parsers support these settings -return setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount) -&& setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize) -&& setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold) -&& setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount) -&& setProperty(factory, "com.ctc.wstx.maxElementDepth", innerElementLevelThreshold) -&& setProperty(factory, "com.ctc.wstx.maxCharacters", maxXMLCharacters) -&& setProperty(factory, "com.ctc.wstx.maxTextLength", maxTextLength); +final boolean wstxMaxs = setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount) +&& setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize) +&& setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold) +&& setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount) +&& setProperty(factory, "com.ctc.wstx.maxElementDepth", innerElementLevelThreshold) +&& setProperty(factory, "com.ctc.wstx.maxCharacters", maxXMLCharacters) +&& setProperty(factory, "com.ctc.wstx.maxTextLength", maxTextLength); +return wstxMaxs +&& setProperty(factory, "com.ctc.wstx.minTextSegment", minTextSegment); } private static boolean setProperty(XMLInputFactory f, String p, Object o) {
cxf git commit: [CXF-7058] Extra CDATA elements added on long CDATA payload Allow passing woodstox config to bypass the issue This closes #169
Repository: cxf Updated Branches: refs/heads/master 042d1dbe5 -> 87775f638 [CXF-7058] Extra CDATA elements added on long CDATA payload Allow passing woodstox config to bypass the issue This closes #169 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/87775f63 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/87775f63 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/87775f63 Branch: refs/heads/master Commit: 87775f63829494a4604752773253f27801a9132e Parents: 042d1db Author: Rodrigo Merino Authored: Wed Sep 14 13:22:27 2016 -0300 Committer: Daniel Kulp Committed: Mon Sep 19 10:01:13 2016 -0400 -- .../org/apache/cxf/staxutils/StaxUtils.java | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/87775f63/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java -- diff --git a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java index 4af5ddf..eb68092 100644 --- a/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java +++ b/core/src/main/java/org/apache/cxf/staxutils/StaxUtils.java @@ -107,6 +107,8 @@ public final class StaxUtils { "org.apache.cxf.stax.maxAttributeSize"; public static final String MAX_TEXT_LENGTH = "org.apache.cxf.stax.maxTextLength"; +public static final String MIN_TEXT_SEGMENT = +"org.apache.cxf.stax.minTextSegment"; public static final String MAX_ELEMENT_COUNT = "org.apache.cxf.stax.maxElementCount"; public static final String MAX_XML_CHARACTERS = @@ -139,6 +141,7 @@ public final class StaxUtils { private static int maxAttributeCount = 500; private static int maxAttributeSize = 64 * 1024; //64K per attribute, likely just "list" will hit private static int maxTextLength = 128 * 1024 * 1024; //128M - more than this should DEFINITLEY use MTOM +private static int minTextSegment = 64; // Same default as woodstox private static long maxElementCount = Long.MAX_VALUE; private static long maxXMLCharacters = Long.MAX_VALUE; @@ -159,6 +162,7 @@ public final class StaxUtils { maxAttributeCount = getInteger(MAX_ATTRIBUTE_COUNT, maxAttributeCount); maxAttributeSize = getInteger(MAX_ATTRIBUTE_SIZE, maxAttributeSize); maxTextLength = getInteger(MAX_TEXT_LENGTH, maxTextLength); +minTextSegment = getInteger(MIN_TEXT_SEGMENT, minTextSegment); maxElementCount = getLong(MAX_ELEMENT_COUNT, maxElementCount); maxXMLCharacters = getLong(MAX_XML_CHARACTERS, maxXMLCharacters); @@ -361,13 +365,15 @@ public final class StaxUtils { private static boolean setRestrictionProperties(XMLInputFactory factory) { //For now, we can only support Woodstox 4.2.x and newer as none of the other //stax parsers support these settings -return setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount) -&& setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize) -&& setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold) -&& setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount) -&& setProperty(factory, "com.ctc.wstx.maxElementDepth", innerElementLevelThreshold) -&& setProperty(factory, "com.ctc.wstx.maxCharacters", maxXMLCharacters) -&& setProperty(factory, "com.ctc.wstx.maxTextLength", maxTextLength); +final boolean wstxMaxs = setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount) +&& setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize) +&& setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold) +&& setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount) +&& setProperty(factory, "com.ctc.wstx.maxElementDepth", innerElementLevelThreshold) +&& setProperty(factory, "com.ctc.wstx.maxCharacters", maxXMLCharacters) +&& setProperty(factory, "com.ctc.wstx.maxTextLength", maxTextLength); +return wstxMaxs +&& setProperty(factory, "com.ctc.wstx.minTextSegment", minTextSegment); } private static boolean setProperty(XMLInputFactory f, String p, Object o) {