diff --git a/source/de/anomic/crawler/retrieval/FTPLoader.java b/source/de/anomic/crawler/retrieval/FTPLoader.java index cff12bd18..740172f30 100644 --- a/source/de/anomic/crawler/retrieval/FTPLoader.java +++ b/source/de/anomic/crawler/retrieval/FTPLoader.java @@ -231,6 +231,7 @@ public class FTPLoader { // if the mimetype and file extension is supported we start to download the file final long size = ftpClient.fileSize(path); + responseHeader.put(HeaderFramework.CONTENT_LENGTH, String.valueOf(size)); String parserError = null; if ((acceptOnlyParseable && (parserError = TextParser.supports(url, mime)) != null) || (size > maxFileSize && maxFileSize >= 0)) { @@ -252,7 +253,7 @@ public class FTPLoader { responseHeader, "200", mp == null ? null : new CrawlProfile(mp), - url.toTokens().getBytes()); + null); return response; } diff --git a/source/de/anomic/crawler/retrieval/Response.java b/source/de/anomic/crawler/retrieval/Response.java index 0fec79f27..bb21ba980 100755 --- a/source/de/anomic/crawler/retrieval/Response.java +++ b/source/de/anomic/crawler/retrieval/Response.java @@ -241,11 +241,11 @@ public class Response { } public long size() { - if (this.content != null) return this.content.length; if (this.responseHeader != null) { // take the size from the response header return this.responseHeader.getContentLength(); } + if (this.content != null) return this.content.length; // the size is unknown return -1; }