if(response.isFetchFail()) {
ctx.error(request, response, "during initial resource fetch");
return;
}
ps.getPath().setVisited(true);
final IPageFingerprint fp = response.getPageFingerprint();
final IPathState par = ps.get404Parent();
final int rcode = response.getResponseCode();
if((par == null && rcode == 404) || (ps.hasParent404Fingerprint(fp))) {
ps.setPageMissing();
ps.unlockChildren();
ctx.debug("Starting parametric checks on unknown path because page is missing.");
parametricChecks.initialize(ps);
return;
}
if(par != null && !response.getBodyAsString().isEmpty() && rcode == 200 && fp.isSame(par.getUnknownFingerprint())) {
ctx.debug("Unknown path fetch matches parent unknown fp, processing as a file.");
ps.getPath().setPathType(PathType.PATH_FILE);
fetchFileProcessor.processResponse(null, request, response, ctx);
return;
}
if(par != null && rcode >= 300 && rcode < 400 && fp.isSame(par.getUnknownFingerprint()) && fp.isSame(par.getPathFingerprint())) {
ctx.debug("Unknown path fetch matches both parent probes, processing as file.");
ps.getPath().setPathType(PathType.PATH_FILE);
fetchFileProcessor.processResponse(null, request, response, ctx);
return;
}