From aa38eb5a20560b6d3e272275a00143627614e004 Mon Sep 17 00:00:00 2001 From: lotus Date: Tue, 14 Jul 2009 08:39:39 +0000 Subject: [PATCH] * maxfilesize -1 for infinite filesize git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6208 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/crawler/HTTPLoader.java | 4 ++-- source/de/anomic/http/httpClientGetMethod.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/crawler/HTTPLoader.java b/source/de/anomic/crawler/HTTPLoader.java index fdf506e79..cb083537e 100644 --- a/source/de/anomic/crawler/HTTPLoader.java +++ b/source/de/anomic/crawler/HTTPLoader.java @@ -174,7 +174,7 @@ public final class HTTPLoader { /* // check if the content length is allowed long contentLength = res.getResponseHeader().getContentLength(); - if (maxFileSize >= 0 && contentLength > maxFileSize) { + if (maxFileSize > 0 && contentLength > maxFileSize) { sb.crawlQueues.errorURL.newEntry(entry, sb.peers.mySeed().hash, new Date(), 1, "file size limit exceeded"); throw new IOException("REJECTED URL " + entry.url() + " because file size '" + contentLength + "' exceeds max filesize limit of " + maxFileSize + " bytes. (HEAD)"); } @@ -186,7 +186,7 @@ public final class HTTPLoader { long contentLength = responseBody.length; // check length again in case it was not possible to get the length before loading - if (maxFileSize >= 0 && contentLength > maxFileSize) { + if (maxFileSize > 0 && contentLength > maxFileSize) { sb.crawlQueues.errorURL.newEntry(entry, sb.peers.mySeed().hash, new Date(), 1, "file size limit exceeded"); throw new IOException("REJECTED URL " + entry.url() + " because file size '" + contentLength + "' exceeds max filesize limit of " + maxFileSize + " bytes. (GET)"); } diff --git a/source/de/anomic/http/httpClientGetMethod.java b/source/de/anomic/http/httpClientGetMethod.java index 56e55c316..55f821a3c 100644 --- a/source/de/anomic/http/httpClientGetMethod.java +++ b/source/de/anomic/http/httpClientGetMethod.java @@ -45,7 +45,7 @@ public class httpClientGetMethod extends GetMethod { public httpClientGetMethod(String uri, long maxfilesize) { super(uri); - this.maxfilesize = maxfilesize; + if (maxfilesize > 0) this.maxfilesize = maxfilesize; } @Override