Skip to content

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

*) Bugfix for "Race condition zwischen httpc und switchboard" See: http://www.yacy-forum.de/viewtopic.php?p=9036

thelia20814291f3d
diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.java
index 75c87657f..dda3297ae 100644
--- a/source/de/anomic/http/httpc.java
+++ b/source/de/anomic/http/httpc.java
@@ -75,7 +75,6 @@ import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.logging.serverLog;
import de.anomic.server.serverCore.Session;
-import de.anomic.plasma.plasmaSwitchboard;
import org.apache.commons.pool.impl.GenericObjectPool;
@@ -131,19 +130,13 @@ public final class httpc {
private String savedRemoteHost = null;
private String requestPath = null;
private boolean allowContentEncoding = true;
- private static plasmaSwitchboard sb;
- private static boolean useYacyReferer = true;
- private static boolean yacyDebugMode = false;
+ static boolean useYacyReferer = true;
+ static boolean yacyDebugMode = false;
static {
// set time-out of InetAddress.getByName cache ttl
java.security.Security.setProperty("networkaddress.cache.ttl" , "60");
java.security.Security.setProperty("networkaddress.cache.negative.ttl" , "0");
- sb = plasmaSwitchboard.getSwitchboard();
- if (sb != null) {
- useYacyReferer = sb.getConfig("useYacyReferer", "true").equals("true");
- yacyDebugMode = sb.getConfig("yacyDebugMode", "false").equals("true");
- }
}
/**
@@ -411,7 +404,7 @@ public final class httpc {
//serverLog.logDebug("HTTPC", handle + " initialized");
this.remoteProxyUse = false;
this.timeout = timeout;
- if(sb != null && yacyDebugMode){
+ if(yacyDebugMode){
this.timeout=60000;
}
this.savedRemoteHost = server;
diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.java
index f40a2c2e7..dbe1a84f8 100644
--- a/source/de/anomic/http/httpdProxyHandler.java
+++ b/source/de/anomic/http/httpdProxyHandler.java
@@ -125,6 +125,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
* Do logging configuration for special proxy access log file
*/
static {
+ // Doing logger initialisation
try {
serverLog.logInfo("PROXY","Configuring proxy access logging ...");
@@ -198,6 +199,10 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
isTransparentProxy = Boolean.valueOf(switchboard.getConfig("isTransparentProxy","false")).booleanValue();
+ // doing httpc init
+ httpc.useYacyReferer = sb.getConfig("useYacyReferer", "true").equals("true");
+ httpc.yacyDebugMode = sb.getConfig("yacyDebugMode", "false").equals("true");
+
// load remote proxy data
remoteProxyHost = switchboard.getConfig("remoteProxyHost","");
try {