Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixes size of document in case the server doesn't give the size in the header

f1ori41e146116ac1
diff --git a/source/de/anomic/crawler/retrieval/Response.java b/source/de/anomic/crawler/retrieval/Response.java
index 82c539fef..8fd3349d2 100755
--- a/source/de/anomic/crawler/retrieval/Response.java
+++ b/source/de/anomic/crawler/retrieval/Response.java
@@ -242,7 +242,7 @@ public class Response {
}
public long size() {
- if (this.responseHeader != null) {
+ if (this.responseHeader != null && this.responseHeader.getContentLengthLong() != -1) {
// take the size from the response header
return this.responseHeader.getContentLengthLong();
}