Merge branch 'extra-info-size' into aitfive-203

This commit is contained in:
Noah Levitt
2014-11-07 15:58:08 -08:00
2 changed files with 5 additions and 3 deletions
@@ -83,14 +83,12 @@ extends Formatter implements Preformatter, CoreAttributeConstants {
} else if (curi.getContentSize() > 0) {
length = Long.toString(curi.getContentSize());
}
mime = curi.getContentType();
} else {
if (curi.getContentSize() > 0) {
length = Long.toString(curi.getContentSize());
}
mime = curi.getContentType();
}
mime = MimetypeUtils.truncate(mime);
mime = MimetypeUtils.truncate(curi.getContentType());
long time = System.currentTimeMillis();
@@ -962,6 +962,10 @@ public class FetchHTTP extends Processor implements Lifecycle {
protected void setSizes(CrawlURI curi, Recorder rec) {
// set reporting size
curi.setContentSize(rec.getRecordedInput().getSize());
// add contentSize to extraInfo so it's available to log in the crawl log
curi.addExtraInfo("contentSize", rec.getRecordedInput().getSize());
// special handling for 304-not modified
if (curi.getFetchStatus() == HttpStatus.SC_NOT_MODIFIED
&& curi.getFetchHistory() != null) {