Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Added parsing within bounds implementation to the generic parser.

lucciomanf8f1959ebb3f
diff --git a/source/net/yacy/document/parser/genericParser.java b/source/net/yacy/document/parser/genericParser.java
index 0d6d64d6b..44d30413a 100644
--- a/source/net/yacy/document/parser/genericParser.java
+++ b/source/net/yacy/document/parser/genericParser.java
@@ -53,6 +53,19 @@ public class genericParser extends AbstractParser implements Parser {
final int timezoneOffset,
final InputStream source)
throws Parser.Failure, InterruptedException {
+ /* Exactly the same implementation when applying limits as only tokens in the location URL are parsed */
+ return parseWithLimits(location, mimeType, charset, scraper, timezoneOffset, source, Integer.MAX_VALUE, Long.MAX_VALUE);
+ }
+
+ @Override
+ public boolean isParseWithLimitsSupported() {
+ return true;
+ }
+
+ @Override
+ public Document[] parseWithLimits(final DigestURL location, final String mimeType, final String charset,
+ final VocabularyScraper scraper, final int timezoneOffset, final InputStream source, final int maxLinks,
+ final long maxBytes) throws Failure, InterruptedException, UnsupportedOperationException {
String filename = location.getFileName();
final Document[] docs = new Document[]{new Document(
location,