Skip to content

Commit

Permalink
*) Bugfix for "Race condition zwischen httpc und switchboard"
Browse files Browse the repository at this point in the history
  • Loading branch information
theli committed Sep 3, 2005
1 parent 286853f commit a208142
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
13 changes: 3 additions & 10 deletions source/de/anomic/http/httpc.java
Expand Up @@ -75,7 +75,6 @@
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;

Expand Down Expand Up @@ -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");
}
}

/**
Expand Down Expand Up @@ -411,7 +404,7 @@ void init(String server, int port, int timeout, boolean ssl) throws IOException
//serverLog.logDebug("HTTPC", handle + " initialized");
this.remoteProxyUse = false;
this.timeout = timeout;
if(sb != null && yacyDebugMode){
if(yacyDebugMode){
this.timeout=60000;
}
this.savedRemoteHost = server;
Expand Down
5 changes: 5 additions & 0 deletions source/de/anomic/http/httpdProxyHandler.java
Expand Up @@ -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 ...");

Expand Down Expand Up @@ -198,6 +199,10 @@ public httpdProxyHandler(serverSwitch sb) {

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 {
Expand Down

0 comments on commit a208142

Please sign in to comment.