*) Bugfix for "Race condition zwischen httpc und switchboard"

See: http://www.yacy-forum.de/viewtopic.php?p=9036

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@644 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 286853fd39
commit a20814291f

@ -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;

@ -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 {

Loading…
Cancel
Save