From 85c65475fa4c03dad5d6561c38d9a2b882540d1e Mon Sep 17 00:00:00 2001 From: sixcooler Date: Tue, 2 Nov 2010 21:18:44 +0000 Subject: [PATCH] smal but important correction of last commit @ HTTPClient (if there is a response it really should be taken to its end) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7290 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/net/yacy/cora/protocol/http/HTTPClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/cora/protocol/http/HTTPClient.java b/source/net/yacy/cora/protocol/http/HTTPClient.java index ec38df626..c12faa34f 100644 --- a/source/net/yacy/cora/protocol/http/HTTPClient.java +++ b/source/net/yacy/cora/protocol/http/HTTPClient.java @@ -447,11 +447,11 @@ public class HTTPClient { byte[] content = null; try { execute(httpUriRequest); - if (httpResponse == null || httpResponse.getStatusLine().getStatusCode() != 200) return null; + if (httpResponse == null) return null; // get the response body final HttpEntity httpEntity = httpResponse.getEntity(); if (httpEntity != null) { - if (httpEntity.getContentLength() < maxBytes) { + if (getStatusCode() == 200 && httpEntity.getContentLength() < maxBytes) { content = EntityUtils.toByteArray(httpEntity); } // TODO: The name of this method is misnomer.