Author: bombe
Date: 2006-06-29 19:37:07 +0000 (Thu, 29 Jun 2006)
New Revision: 9405
Modified:
trunk/freenet/src/freenet/clients/http/BookmarkManager.java
trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
trunk/freenet/src/freenet/node/Node.java
Log:
only create fproxy subconfig object once
Modified: trunk/freenet/src/freenet/clients/http/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/BookmarkManager.java 2006-06-29
16:39:44 UTC (rev 9404)
+++ trunk/freenet/src/freenet/clients/http/BookmarkManager.java 2006-06-29
19:37:07 UTC (rev 9405)
@@ -78,16 +78,10 @@
}
}
- public BookmarkManager(Node n) {
+ public BookmarkManager(Node n, SubConfig sc) {
this.bookmarks = new Vector();
this.node = n;
this.uskcb = new USKUpdatedCallback();
- SubConfig sc = null;
- try {
- sc = new SubConfig("fproxy", n.config);
- } catch (IllegalArgumentException iae1) {
- sc = n.config.get("fproxy");
- }
sc.register("bookmarks", n.isTestnetEnabled() ?
DEFAULT_TESTNET_BOOKMARKS : DEFAULT_DARKNET_BOOKMARKS, 0, false, "List of
bookmarks", "A list of bookmarked freesites", makeCB());
String[] initialbookmarks = sc.getStringArr("bookmarks");
Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2006-06-29
16:39:44 UTC (rev 9404)
+++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2006-06-29
19:37:07 UTC (rev 9405)
@@ -321,16 +321,9 @@
}
}
- public static void maybeCreateFProxyEtc(Node node, Config config)
throws IOException, InvalidConfigValueException {
+ public static void maybeCreateFProxyEtc(Node node, Config config,
SubConfig fproxyConfig) throws IOException, InvalidConfigValueException {
- SubConfig fproxyConfig = null;
try {
- fproxyConfig = new SubConfig("fproxy", config);
- } catch (IllegalArgumentException iae1) {
- fproxyConfig = config.get("fproxy");
- }
-
- try {
SimpleToadletServer server = new
SimpleToadletServer(fproxyConfig, node);
HighLevelSimpleClient client =
node.makeClient(RequestStarter.INTERACTIVE_PRIORITY_CLASS);
Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java 2006-06-29 16:39:44 UTC (rev
9404)
+++ trunk/freenet/src/freenet/node/Node.java 2006-06-29 19:37:07 UTC (rev
9405)
@@ -1534,14 +1534,15 @@
throw new NodeInitException(EXIT_COULD_NOT_START_FCP,
"Could not start FCP: "+e);
}
- bookmarkManager = new BookmarkManager(this);
+ SubConfig fproxyConfig = new SubConfig("fproxy", config);
+ bookmarkManager = new BookmarkManager(this, fproxyConfig);
pluginManager2 = new freenet.plugin.PluginManager(this);
// FProxy
// FIXME this is a hack, the real way to do this is plugins
try {
- FProxyToadlet.maybeCreateFProxyEtc(this, config);
+ FProxyToadlet.maybeCreateFProxyEtc(this, config,
fproxyConfig);
} catch (IOException e) {
e.printStackTrace();
throw new
NodeInitException(EXIT_COULD_NOT_START_FPROXY, "Could not start FProxy: "+e);