fixed garbage in HTCACHE

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4663 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
danielr 2008-04-07 16:46:45 +00:00
parent 225f9fd429
commit 8b2efb6f8c

View File

@ -28,6 +28,7 @@ package de.anomic.http;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.zip.GZIPInputStream;
import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpMethod;
@ -115,8 +116,12 @@ public class JakartaCommonsHttpResponse implements HttpResponse {
* @throws IOException * @throws IOException
*/ */
public InputStream getDataAsStream() throws IOException { public InputStream getDataAsStream() throws IOException {
InputStream inStream = method.getResponseBodyAsStream();
if(getResponseHeader().gzip()) {
inStream = new GZIPInputStream(inStream);
}
// count bytes for overall http-statistics // count bytes for overall http-statistics
return new httpdByteCountInputStream(method.getResponseBodyAsStream(), incomingAccountingName); return new httpdByteCountInputStream(inStream, incomingAccountingName);
} }
/* /*