Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
* fix negative filelength for files >2G
f1orie4aabaa1c30e
diff --git a/source/de/anomic/crawler/retrieval/Response.java b/source/de/anomic/crawler/retrieval/Response.javaindex bb21ba980..d3f29fda6 100755--- a/source/de/anomic/crawler/retrieval/Response.java+++ b/source/de/anomic/crawler/retrieval/Response.java@@ -243,7 +243,7 @@ public class Response {public long size() {if (this.responseHeader != null) {// take the size from the response header- return this.responseHeader.getContentLength();+ return this.responseHeader.getContentLengthLong();}if (this.content != null) return this.content.length;// the size is unknowndiff --git a/source/net/yacy/cora/protocol/HeaderFramework.java b/source/net/yacy/cora/protocol/HeaderFramework.javaindex 4b21f7622..266aa5979 100644--- a/source/net/yacy/cora/protocol/HeaderFramework.java+++ b/source/net/yacy/cora/protocol/HeaderFramework.java@@ -442,6 +442,23 @@ public class HeaderFramework extends TreeMap<String, String> implements Map<Strireturn -1;}+ /*+ * provide method, which can handle big filelengths (for example from ftp)+ * because we can't change the interface in apache httpclient+ *+ * @see org.apache.commons.fileupload.RequestContext#getContentLength()+ */+ public long getContentLengthLong() {+ if (containsKey(CONTENT_LENGTH)) {+ try {+ return Long.parseLong(get(CONTENT_LENGTH));+ } catch (final NumberFormatException e) {+ return -1;+ }+ }+ return -1;+ }+/** (non-Javadoc)*