*) bugfix for usage of httpc without gzip content encoding

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@369 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
theli 2005-07-04 11:25:25 +00:00
parent 0e2c33ee55
commit 57c30f1d78
4 changed files with 4 additions and 3 deletions

View File

@ -665,7 +665,7 @@ public final class httpc {
public response GET(String path, httpHeader requestHeader) throws IOException {
//serverLog.logDebug("HTTPC", handle + " requested GET '" + path + "', time = " + (System.currentTimeMillis() - handle));
try {
boolean zipped = (this.allowContentEncoding) ? true : httpd.shallTransportZipped(path);
boolean zipped = (!this.allowContentEncoding) ? false : httpd.shallTransportZipped(path);
send(httpHeader.METHOD_GET, path, requestHeader, zipped);
response r = new response(zipped);
//serverLog.logDebug("HTTPC", handle + " returned GET '" + path + "', time = " + (System.currentTimeMillis() - handle));

View File

@ -724,7 +724,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
} else {
if (e.getMessage().indexOf("Corrupt GZIP trailer") >= 0) {
// just do nothing, we leave it this way
this.theLogger.logDebug("ignoring bad gzip trail for URL " + url + " (" + e.getMessage() + ")",e);
this.theLogger.logDebug("ignoring bad gzip trail for URL " + url + " (" + e.getMessage() + ")");
this.forceConnectionClose();
} else if ((remote != null)&&(remote.isClosed())) { // TODO: query for broken pipe
errorMessage = "destination host unexpectedly closed connection";

View File

@ -282,7 +282,7 @@ public final class plasmaCrawlWorker extends Thread {
httpHeader requestHeader = new httpHeader();
requestHeader.put("User-Agent", httpdProxyHandler.userAgent);
requestHeader.put("Referer", referer);
requestHeader.put("Accept-Encoding", "gzip,deflate");
if (useContentEncodingGzip) requestHeader.put("Accept-Encoding", "gzip,deflate");
//System.out.println("CRAWLER_REQUEST_HEADER=" + requestHeader.toString()); // DEBUG

View File

@ -176,6 +176,7 @@ public final class serverCodings {
return out;
} catch (ArrayIndexOutOfBoundsException e) {
// maybe the input was not base64
e.printStackTrace();
return null;
}
}