From ec84a52adb1b67305e9b44901f1cc4903be9819c Mon Sep 17 00:00:00 2001 From: danielr Date: Tue, 29 Apr 2008 16:06:54 +0000 Subject: [PATCH] change for problem with NPE (seen as "PROXY Unknown Error while processing request") git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4745 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../de/anomic/http/JakartaCommonsHttpResponse.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/http/JakartaCommonsHttpResponse.java b/source/de/anomic/http/JakartaCommonsHttpResponse.java index 65dd4cb33..e0050ab4d 100644 --- a/source/de/anomic/http/JakartaCommonsHttpResponse.java +++ b/source/de/anomic/http/JakartaCommonsHttpResponse.java @@ -118,11 +118,15 @@ public class JakartaCommonsHttpResponse { */ public InputStream getDataAsStream() throws IOException { InputStream inStream = method.getResponseBodyAsStream(); - if (getResponseHeader().gzip()) { - inStream = new GZIPInputStream(inStream); + if(inStream != null) { + if (getResponseHeader().gzip()) { + inStream = new GZIPInputStream(inStream); + } + // count bytes for overall http-statistics + return new httpdByteCountInputStream(inStream, incomingAccountingName); + } else { + return null; } - // count bytes for overall http-statistics - return new httpdByteCountInputStream(inStream, incomingAccountingName); } /*