From ee3cef91e80decc36c64d9b9d9bdebc71b191806 Mon Sep 17 00:00:00 2001 From: f1ori Date: Tue, 28 Dec 2010 02:15:22 +0000 Subject: [PATCH] * fix filesize in ftp crawls git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7402 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/crawler/retrieval/FTPLoader.java | 3 ++- source/de/anomic/crawler/retrieval/Response.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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; }