abhinav-phi commented on code in PR #2121:
URL: https://github.com/apache/stormcrawler/pull/2121#discussion_r4462673750
##########
core/src/main/java/org/apache/stormcrawler/protocol/okhttp/HttpProtocol.java:
##########
@@ -442,7 +442,15 @@ public ProtocolResponse getProtocolOutput(String url,
final Metadata metadata)
final String pageMaxContentStr =
metadata.getFirstValue("http.content.limit");
if (StringUtils.isNotBlank(pageMaxContentStr)) {
try {
- pageMaxContent = Integer.parseInt(pageMaxContentStr);
+ int metadataLimit = Integer.parseInt(pageMaxContentStr);
+ /*
+ * per-URL metadata can tighten the limit but not remove
it:
+ * a value of -1 means "no limit" and would turn the finite
+ * global limit of the operator into an unbounded read
+ */
+ if (metadataLimit != -1 || globalMaxContent == -1) {
Review Comment:
the merged version fixes this: `http.robots.content.limit` is now 524288 by
default, and the comment says -1 means "same as http.content.limit". the
mismatch was in the earlier revision, not in what landed.
--
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]