Skip to content

Commit

Permalink
*) bugfix for usage of httpc without gzip content encoding
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@369 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
theli committed Jul 4, 2005
1 parent 0e2c33e commit 57c30f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/de/anomic/http/httpc.java
Expand Up @@ -665,7 +665,7 @@ private void send(String method, String path, httpHeader header, boolean zipped)
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));
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/http/httpdProxyHandler.java
Expand Up @@ -724,7 +724,7 @@ private void fulfillRequestFromWeb(Properties conProp, URL url,String ext, httpH
} 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";
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/plasma/plasmaCrawlWorker.java
Expand Up @@ -282,7 +282,7 @@ private static void load(
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

Expand Down
1 change: 1 addition & 0 deletions source/de/anomic/server/serverCodings.java
Expand Up @@ -176,6 +176,7 @@ public byte[] decodeBase64(String in) {
return out;
} catch (ArrayIndexOutOfBoundsException e) {
// maybe the input was not base64
e.printStackTrace();
return null;
}
}
Expand Down

0 comments on commit 57c30f1

Please sign in to comment.