From ad4b2131450bc007ce9e279945050dd42185792c Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 2 Feb 2014 03:47:12 +0100 Subject: [PATCH] remove unused static var from HTTPDProxyHandler --- htroot/SettingsAck_p.java | 6 +++--- source/net/yacy/server/http/HTTPDProxyHandler.java | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index ea9147349..f2373b1ff 100644 --- a/htroot/SettingsAck_p.java +++ b/htroot/SettingsAck_p.java @@ -177,9 +177,9 @@ public class SettingsAck_p { if (post.containsKey("httpNetworking")) { // set transparent proxy flag - HTTPDProxyHandler.isTransparentProxy = post.containsKey("isTransparentProxy"); - env.setConfig("isTransparentProxy", HTTPDProxyHandler.isTransparentProxy); - prop.put("info_isTransparentProxy", HTTPDProxyHandler.isTransparentProxy ? "on" : "off"); + boolean isTransparentProxy = post.containsKey("isTransparentProxy"); + env.setConfig("isTransparentProxy", isTransparentProxy); + prop.put("info_isTransparentProxy", isTransparentProxy ? "on" : "off"); // setting the keep alive property HTTPDemon.keepAliveSupport = post.containsKey("connectionKeepAliveSupport"); diff --git a/source/net/yacy/server/http/HTTPDProxyHandler.java b/source/net/yacy/server/http/HTTPDProxyHandler.java index 344412393..6ce08fdf7 100644 --- a/source/net/yacy/server/http/HTTPDProxyHandler.java +++ b/source/net/yacy/server/http/HTTPDProxyHandler.java @@ -100,7 +100,6 @@ public final class HTTPDProxyHandler { private static final HashSet yellowList; private static int timeout = 60000; private static boolean yacyTrigger = true; - public static boolean isTransparentProxy = false; private static Process redirectorProcess = null; private static boolean redirectorEnabled = false; private static PrintWriter redirectorWriter = null; @@ -113,7 +112,6 @@ public final class HTTPDProxyHandler { // creating a logger private static final ConcurrentLog log = new ConcurrentLog("PROXY"); - private static boolean doAccessLogging = false; /** * Do logging configuration for special proxy access log file */ @@ -123,13 +121,11 @@ public final class HTTPDProxyHandler { sb = Switchboard.getSwitchboard(); if (sb != null) { - isTransparentProxy = Boolean.parseBoolean(sb.getConfig("isTransparentProxy","false")); - // set timeout timeout = Integer.parseInt(sb.getConfig("proxy.clientTimeout", "60000")); // create a htRootPath: system pages - htRootPath = new File(sb.getAppPath(), sb.getConfig("htRootPath","htroot")); + htRootPath = new File(sb.getAppPath(), sb.getConfig(SwitchboardConstants.HTROOT_PATH,SwitchboardConstants.HTROOT_PATH_DEFAULT)); if (!(htRootPath.exists())) { if(!htRootPath.mkdir()) ConcurrentLog.severe("PROXY", "could not create htRoot "+ htRootPath); @@ -170,7 +166,6 @@ public final class HTTPDProxyHandler { txtLog.setLevel(Level.FINEST); proxyLogger.addHandler(txtLog); - doAccessLogging = true; log.info("Proxy access logging configuration done." + "\n\tFilename: " + pattern + "\n\tLimit: " + limitStr + @@ -1173,8 +1168,6 @@ public final class HTTPDProxyHandler { */ private final static synchronized void logProxyAccess(final HashMap conProp) { - if (!doAccessLogging) return; - logMessage.setLength(0); // Timestamp