You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/06/04 13:47:37 UTC
[GitHub] [daffodil] tuxji commented on a change in pull request #585: Fix max length check for xs:hexBinary
tuxji commented on a change in pull request #585:
URL: https://github.com/apache/daffodil/pull/585#discussion_r645554529
##########
File path: daffodil-propgen/src/main/resources/org/apache/daffodil/xsd/dafext.xsd
##########
@@ -132,12 +132,14 @@
<xs:element name="blobChunkSizeInBytes" default="4096" minOccurs="0">
<xs:annotation>
<xs:documentation>
- When reading/writing blob data, the maximum number of bytes to read/write at a time.
+ When reading/writing blob data, the maximum number of bytes to read/write
+ at a time. This is also used when parsing xs:hexBinary data.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
+ <xs:maxInclusive value="268435455" /> <!-- This is (MaxInt / 8), needed because some uses of this need this tunable in bits as an integer -->
Review comment:
Let's make this comment both shorter and clearer:
Limit to (MaxInt / 8) because some places convert this tunable to bits
##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/BlobLengthParsers.scala
##########
@@ -24,38 +24,32 @@ import org.apache.daffodil.processors.ElementRuntimeData
import org.apache.daffodil.processors.LengthInBitsEv
import org.apache.daffodil.util.MaybeULong
-sealed abstract class BlobLengthParser(override val context: ElementRuntimeData)
- extends PrimParser {
-
- protected def getLengthInBits(pstate: PState): Long
-
- override final def parse(start: PState): Unit = {
+trait ByteChunkWriter { self: PrimParser =>
+
+ /**
+ * Read nBits of data from the input source associated with pstate in chunks.
+ * For each chunk, the writeChunk function is called, which takes as
Review comment:
Let's make the comment clearer that the writeChunk function is passed as a parameter:
* For each chunk, the writeChunk function passed as a parameter is called, which takes as
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org