tballison commented on code in PR #3211:
URL: https://github.com/apache/tika/pull/3211#discussion_r4054938074
##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pkg-module/src/main/java/org/apache/tika/parser/pkg/ZipParser.java:
##########
@@ -242,7 +243,7 @@ public void parse(TikaInputStream tis, ContentHandler
handler, Metadata metadata
parseWithZipFile(zipFile, tis, handler, metadata, context, config);
} else {
// Use streaming - enable rewind for DATA_DESCRIPTOR retry
- tis.enableRewind();
+ tis.enableRewind(context.get(CacheMemoryBudget.class));
Review Comment:
Don't agree.
##########
tika-core/src/main/java/org/apache/tika/parser/inference/InferenceDispatcher.java:
##########
@@ -170,14 +170,15 @@ private void offer(InputKind kind, MediaType type,
Metadata target, Metadata par
if (!runs(binding, context) || !binding.accepts(kind, type,
target)) {
continue;
}
- // a media unit is the whole file; its maxBytes bounds one
segment, in the task
+ // a media unit is the whole file; maxBytes and maxChunks bound
its segments, in the task
if (kind != InputKind.MEDIA && binding.getMaxBytes() >= 0 && size
> binding.getMaxBytes()) {
state.dropped.merge(binding.getId() + " over maxBytes", 1,
Integer::sum);
continue;
}
List<InferenceUnit> units =
state.byBinding.computeIfAbsent(binding.getId(),
k -> new ArrayList<>());
- if (binding.getMaxChunks() >= 0 && units.size() >=
binding.getMaxChunks()) {
+ if (kind != InputKind.MEDIA && binding.getMaxChunks() >= 0
+ && units.size() >= binding.getMaxChunks()) {
Review Comment:
Good find
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]