Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed bad-gzip-trailer behaviour (now cuts off trailer)

orbiter87a61a01c276
diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.java
index dcd7d0c21..980b7945e 100644
--- a/source/de/anomic/http/httpdProxyHandler.java
+++ b/source/de/anomic/http/httpdProxyHandler.java
@@ -573,6 +573,17 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// and most possible corrupted
if (cacheFile.exists()) cacheFile.delete();
respondHeader(respond,"404 client unexpectedly closed connection", new httpHeader(null));
+ } catch (IOException e) {
+ // can have various reasons
+ if (cacheFile.exists()) cacheFile.delete();
+ if (e.getMessage().indexOf("Corrupt GZIP trailer") >= 0) {
+ // just do nothing, we leave it this way
+ log.logDebug("ignoring bad gzip trail for URL " + url + " (" + e.getMessage() + ")");
+ } else {
+ respondHeader(respond,"404 client unexpectedly closed connection", new httpHeader(null));
+ log.logDebug("IOError for URL " + url + " (" + e.getMessage() + ") - responded 404");
+ e.printStackTrace();
+ }
}
remote.close();
} catch (Exception e) {