");
- for (Iterator iter = info.getOptions().keySet().iterator(); iter.hasNext(); ) {
- String key = (String)iter.next();
- String val = info.getOption(key);
+ Map p = info.getOptionsMap();
+ for (Map.Entry e : (Set) p.entrySet()) {
+ String key = (String) e.getKey();
+ String val = (String) e.getValue();
buf.append(DataHelper.stripHTML(key)).append(" = ").append(DataHelper.stripHTML(val)).append("
\n");
}
buf.append("
-The unprecedented network growth starting October 5th -has dramatically increased network congestion, especially on evenings (UTC) -and weekends. The last two releases contained a few changes that we hoped -would relieve the pressure, but unfortunately these measures have been only -modest successes. The primary issue is to limit the number of direct router -to-router connections in the network. This isn't a new problem; we've been -working on it for several years, usually with good results. However, the recent -growth pushed us over the edge once again. -
-Release 0.8.11 includes several more changes to reduce the number of router-to-router -connections and increase connection and tunnel build capacity. The goal, of course, -is to improve tunnel build success rates and general reliability. As always, there's -a few bug fixes and translation updates. -
-We welcome all our new users. Please be patient as we work to improve network -performance. Debugging congestion problems in a distributed anonymous network -is a continuing challenge. Please help improve the network -by restarting your router once the upgrade is downloaded. - +The 0.8.12 release fixes several serious message corruption bugs. +It also contains a redesign of the router's congestion control, and continued +optimization of CPU and memory usage. We are hopeful that these changes will +improve network performance. Upgrading is recommended.
Say hello to the volunteers on the #i2p-help IRC channel. Get involved, diff --git a/installer/resources/readme/readme.html b/installer/resources/readme/readme.html index b5ad53ca8..05c8c5d16 100644 --- a/installer/resources/readme/readme.html +++ b/installer/resources/readme/readme.html @@ -59,8 +59,6 @@
irc.postman.i2p
or irc.freshcoffee.i2p
). These channels are also available outside of I2P's encrypted, anonymous network via Freenode IRC.
-Echelon's I2P Resources
echelon.i2p: I2P software
archief met broncode (waar toegestaan), informatie over I2P, inclusief een beginner's guide en pre-release ontwikkelaars versies van I2P voor de avonturiers om te proberen.
Ugha's Wiki
ugha.i2p: Een open wiki die iedereen kan bewerken met veel informatie over I2P, help voor beginners en meer links voor het I2P netwerk en meer.
- I2P-to-Freenet Proxy
fproxy.tino.i2p:
- Neem een kijkje in de wereld van het Freenet netwerk met Tino's I2P-to-Freenet proxy.
The Planet (on I2P)
planet.i2p: Een RSS aggregator site die nieuwswaardigheden en evenementen rondom I2P verzamelt en publiceerd in één plek. Een goede site om te bezoeken om de community aan het werk te zien!
Eepsite Search Engine
eepsites.i2p: Een
anonieme zoek machine.
@@ -86,7 +84,7 @@ Als je achter een verbiedende firewall zit maar wel onbeperkt uitgaande toegang,
of langs komen in
#i2p-help, #i2p or #i2p-chat op I2P's Internet IRC netwerk (irc.postman.i2p
or irc.freshcoffee.i2p
). Deze kanalen zijn tevens beschikbaar buiten I2P's anonieme versleutelde netwerk via Freenode IRC.
-Bugs melden
Als je een bug wil melden, maak een ticket aan op trac.i2p2.i2p. Voor ontwikkelaar-gerelateerde discussies, bezoek zzz's developer forums of bezoek het developer kanaal op I2P's IRC netwerk. Ontwikkelaars kunnen de broncode doorbladeren op zzz's mtn repository viewer, Sponge's instance, of via trac.i2p2.i2p. We gebruiken hoofdzakelijk monotone om de broncode bij te beheren.
+Bugs melden
Als je een bug wil melden, maak een ticket aan op trac.i2p2.i2p. Voor ontwikkelaar-gerelateerde discussies, bezoek zzz's developer forums of bezoek het developer kanaal op I2P's IRC netwerk. Ontwikkelaars kunnen de broncode doorbladeren op zzz's mtn repository viewer of via trac.i2p2.i2p. We gebruiken hoofdzakelijk monotone om de broncode bij te beheren.
Raak betrokken!
I2P word ontwikkeld en onderhouden door hoofdzakelijk ongefinancierde en vrijwillige community leden. We accepteren graag donaties, welke zullen besteed aan essentiele hosting en administratie kosten. We hebben contante beloningen voor aspecten van I2P voor ontwikkelaars welke graag mee willen ontwikkelen, we zijn altijd opzoek naar meer Java coders, vertalers, promoters en gebruikers om I2P te helpen groeien. Hoe groter het I2P netwerk, hoe meer iedereen van de voordelen profiteert, simpelweg al je vrienden vertellen over I2P en ze helpen het te installeren is al een grote hulp. Voor meer informatie over hoe je betrokken kan raken, bezoek de vrijwilligers pagina op de website.
diff --git a/installer/resources/readme/readme_pt.html b/installer/resources/readme/readme_pt.html
index dbe0b3de4..2b6768420 100644
--- a/installer/resources/readme/readme_pt.html
+++ b/installer/resources/readme/readme_pt.html
@@ -10,7 +10,6 @@
conexões seguras e anônimas para www.i2p2.de
eepsites.i2p: búscador para as páginas I2P
ugha.i2p: página de Ugha; um wiki público com muitos links
- fproxy.tino.i2p: um proxy para acessar à Freenet
echelon.i2p: arquivo de software e informações sobre I2P (com aplicações de BitTorrent, iMule, I2PFox, I2P-Messenger, ...)
pastethis.i2p: pastebin anônimo
diff --git a/installer/resources/readme/readme_ru.html b/installer/resources/readme/readme_ru.html
index 407cc0676..ac7805151 100644
--- a/installer/resources/readme/readme_ru.html
+++ b/installer/resources/readme/readme_ru.html
@@ -49,8 +49,6 @@
Ресурсы Echelon-а
echelon.i2p: архив I2P
софта с исходными текстами (где позволяет лицензия), информация об I2P, включая руководство для начинающих и пре-релизные девелоперские сборки I2P для тестирования.
Вики Ugha-и
ugha.i2p: Открытая вики, которую может редактировать любой, с изобилием информации об I2P, помощью для начинающих, дополнительными ссылками на ресурсы сети и т.д.
- I2P-to-Freenet прокси
fproxy.tino.i2p:
- Взгляните в мир обмена данными закрытой сети Freenet с помощью I2P-to-Freenet прокси-сервера Tino.
Планета I2P
planet.i2p: RSS-аггрегатор, который собирает новости и события в I2P и публикует их в одном месте. Хороший сайт, который можно посетить и увидеть сообщество в работе!
Поисковик по I2P-сайтам
eepsites.i2p: Анонимно-хостящийся поисковик по eepsite-ам.
Здоровье сети I2P
stats.i2p: посмотрите различные аспекты сетевой производительности с помощью этого сайта для мониторинга сети I2P, поддерживаемого zzz.
@@ -90,7 +88,7 @@
или посетить каналы
#i2p-help, #i2p or #i2p-chat во внутренней IRC-сети I2P (irc.postman.i2p
или irc.freshcoffee.i2p
). Эти каналы так же доступны извне I2P через Freenode IRC.
-Составление отчётов об ошибках
Если вы хотите сообщить об ошибке, пожалуйста заведите заявку на сайте trac.i2p2.i2p. Для ведения дискуссий, относящихся к разработке, посетите форум разработчиков у zzz, или приходите на девелоперский канал в IRC-сети I2P. Программисты могут захотеть посмотреть исходные коды в веб-просмотрщике mtn-репозитория от zzz, инсталляции у Sponge-а, или через trac.i2p2.i2p. Преимущественно, мы используем monotone для управления исходным кодом.
+Составление отчётов об ошибках
Если вы хотите сообщить об ошибке, пожалуйста заведите заявку на сайте trac.i2p2.i2p. Для ведения дискуссий, относящихся к разработке, посетите форум разработчиков у zzz, или приходите на девелоперский канал в IRC-сети I2P. Программисты могут захотеть посмотреть исходные коды в веб-просмотрщике mtn-репозитория от zzz или через trac.i2p2.i2p. Преимущественно, мы используем monotone для управления исходным кодом.
Вовлекайтесь!
I2P разрабатывается и сопровождается в основном за счёт неоплачиваемого, добровольного участия членов сообщества. Мы рады принимать пожертвования, которые идут на необходимые административные затраты и хостинг. Для разработчиков, ищущих материальные стимулы, у нас есть денежные премии за работу над некоторыми аспектами I2P, и мы всегда ищем Java программистов, переводчиков, популяризаторов и пользователей, помогающих I2P расширяться. Чем больше I2P-сеть, тем больше общая выгода, поэтому простой рассказ об I2P своим друзьям (и помощь с установкой и настройкой если нужно) - уже большая помощь. Для получения дальнейшей информации о том, как вы можете принять участие, посетите страницу для добровольцев на официальном сайте.
diff --git a/installer/resources/readme/readme_sv.html b/installer/resources/readme/readme_sv.html
index 98fe0ddf7..55d07efa5 100644
--- a/installer/resources/readme/readme_sv.html
+++ b/installer/resources/readme/readme_sv.html
@@ -20,8 +20,6 @@ href="http://www.i2p2.de/">www.i2p2.de
sökmotor
ugha.i2p: ugha's eepsida, en
wiki som alla kan förändra, innehåller många länkar
- fproxy.tino.i2p:
-Freenet proxy
echelon.i2p: programvaruförråd och information om I2P
pastethis.i2p: anonym och säker pastebin
diff --git a/installer/resources/readme/readme_zh.html b/installer/resources/readme/readme_zh.html
index eb58e4e88..7ba9c528c 100644
--- a/installer/resources/readme/readme_zh.html
+++ b/installer/resources/readme/readme_zh.html
@@ -9,7 +9,6 @@
www.i2p2.i2p 与镜像 i2p-projekt.i2p: 可以安全匿名的访问I2P官网 www.i2p2.de
eepsites.i2p: I2P网络里的 “Google” 可以用来搜索各个匿名小站
ugha.i2p:UGHA 的 I2P 小站,开放编辑的WIKI,有丰富的链接
- fproxy.tino.i2p:FREENET 代理
echelon.i2p:软件存档及有关I2P的相关文档 (例如 I2P Messenger 基于I2P的匿名聊天工具等)
pastethis.i2p:安全匿名的公共剪贴板
diff --git a/installer/resources/wrapper.config b/installer/resources/wrapper.config
index 6f3641461..9eee7dda2 100644
--- a/installer/resources/wrapper.config
+++ b/installer/resources/wrapper.config
@@ -168,6 +168,10 @@ wrapper.logfile.maxfiles=2
# Log Level for sys/event log output. (See docs for log levels)
wrapper.syslog.loglevel=NONE
+# these will shut down or crash the JVM
+wrapper.signal.mode.usr1=IGNORE
+wrapper.signal.mode.usr2=IGNORE
+
# choose what to do if the JVM kills itself based on the exit code
wrapper.on_exit.default=SHUTDOWN
wrapper.on_exit.0=SHUTDOWN
diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java
index f76e6eb49..153b14e7c 100644
--- a/router/java/src/net/i2p/router/Blocklist.java
+++ b/router/java/src/net/i2p/router/Blocklist.java
@@ -488,9 +488,7 @@ public class Blocklist {
for (int j = 0; j < paddr.size(); j++) {
RouterAddress pa = (RouterAddress) pladdr.get(j);
if (pa == null) continue;
- Properties pprops = pa.getOptions();
- if (pprops == null) continue;
- String phost = pprops.getProperty("host");
+ String phost = pa.getOption("host");
if (phost == null) continue;
if (oldphost != null && oldphost.equals(phost)) continue;
oldphost = phost;
diff --git a/router/java/src/net/i2p/router/PeerSelectionCriteria.java b/router/java/src/net/i2p/router/PeerSelectionCriteria.java
index 8732b7166..2702ff5ec 100644
--- a/router/java/src/net/i2p/router/PeerSelectionCriteria.java
+++ b/router/java/src/net/i2p/router/PeerSelectionCriteria.java
@@ -12,6 +12,7 @@ package net.i2p.router;
* Defines the criteria for selecting a set of peers for use when searching the
* PeerManager
*
+ * Only used by PeerTestJob, which may not have a point.
*/
public class PeerSelectionCriteria {
/** The peers will be used in a tunnel */
diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java
index 08ea93bd8..0e95d8c6e 100644
--- a/router/java/src/net/i2p/router/Router.java
+++ b/router/java/src/net/i2p/router/Router.java
@@ -60,7 +60,7 @@ import net.i2p.util.SimpleScheduler;
*
*/
public class Router implements RouterClock.ClockShiftListener {
- private final Log _log;
+ private Log _log;
private final RouterContext _context;
private final Map _config;
/** full path */
@@ -77,9 +77,9 @@ public class Router implements RouterClock.ClockShiftListener {
private ShutdownHook _shutdownHook;
/** non-cancellable shutdown has begun */
private volatile boolean _shutdownInProgress;
- private final I2PThread _gracefulShutdownDetector;
- private final RouterWatchdog _watchdog;
- private final Thread _watchdogThread;
+ private I2PThread _gracefulShutdownDetector;
+ private RouterWatchdog _watchdog;
+ private Thread _watchdogThread;
public final static String PROP_CONFIG_FILE = "router.configLocation";
@@ -128,9 +128,17 @@ public class Router implements RouterClock.ClockShiftListener {
System.setProperty("Dorg.mortbay.util.FileResource.checkAliases", "true");
}
+ /**
+ * Instantiation only. Starts no threads. Does not install updates.
+ * RouterContext is created but not initialized.
+ * You must call runRouter() after any constructor to start things up.
+ */
public Router() { this(null, null); }
+
public Router(Properties envProps) { this(null, envProps); }
+
public Router(String configFilename) { this(configFilename, null); }
+
public Router(String configFilename, Properties envProps) {
_gracefulExitCode = -1;
_config = new ConcurrentHashMap();
@@ -233,16 +241,20 @@ public class Router implements RouterClock.ClockShiftListener {
String now = Long.toString(System.currentTimeMillis());
_config.put("router.firstInstalled", now);
_config.put("router.updateLastInstalled", now);
+ // only compatible with new i2prouter script
+ _config.put("router.gracefulHUP", "true");
saveConfig();
}
+ // ********* Start no threads before here ********* //
+ }
- // This is here so that we can get the directory location from the context
- // for the zip file and the base location to unzip to.
- // If it does an update, it never returns.
- // I guess it's better to have the other-router check above this, we don't want to
- // overwrite an existing running router's jar files. Other than ours.
- installUpdates();
-
+ /**
+ * Initializes the RouterContext.
+ * Starts some threads. Does not install updates.
+ * All this was in the constructor.
+ * @since 0.8.12
+ */
+ private void startupStuff() {
// ********* Start no threads before here ********* //
//
// NOW we can start the ping file thread.
@@ -372,11 +384,18 @@ public class Router implements RouterClock.ClockShiftListener {
public RouterContext getContext() { return _context; }
+ /**
+ * Initializes the RouterContext.
+ * Starts the threads. Does not install updates.
+ */
void runRouter() {
+ if (_isAlive)
+ throw new IllegalStateException();
+ startupStuff();
_isAlive = true;
_started = _context.clock().now();
try {
- Runtime.getRuntime().removeShutdownHook(_shutdownHook);
+ Runtime.getRuntime().addShutdownHook(_shutdownHook);
} catch (IllegalStateException ise) {}
I2PThread.addOOMEventListener(_oomListener);
@@ -987,9 +1006,12 @@ public class Router implements RouterClock.ClockShiftListener {
/**
* Cancel the JVM runtime hook before calling this.
+ * Called by the ShutdownHook.
* NOT to be called by others, use shutdown().
*/
public void shutdown2(int exitCode) {
+ _shutdownInProgress = true;
+ _log.log(Log.CRIT, "Starting final shutdown(" + exitCode + ')');
// So we can get all the way to the end
// No, you can't do Thread.currentThread.setDaemon(false)
if (_killVMOnEnd) {
@@ -1004,6 +1026,7 @@ public class Router implements RouterClock.ClockShiftListener {
// Run the shutdown hooks first in case they want to send some goodbye messages
// Maybe we need a delay after this too?
for (Runnable task : _context.getShutdownTasks()) {
+ //System.err.println("Running shutdown task " + task.getClass());
if (_log.shouldLog(Log.WARN))
_log.warn("Running shutdown task " + task.getClass());
try {
@@ -1098,7 +1121,7 @@ public class Router implements RouterClock.ClockShiftListener {
//Runtime.getRuntime().halt(exitCode);
// allow the Runtime shutdown hooks to execute
Runtime.getRuntime().exit(exitCode);
- } else {
+ } else if (System.getProperty("java.vendor").contains("Android")) {
Runtime.getRuntime().gc();
}
}
@@ -1266,13 +1289,18 @@ public class Router implements RouterClock.ClockShiftListener {
public static void main(String args[]) {
System.out.println("Starting I2P " + RouterVersion.FULL_VERSION);
- // installUpdates() moved to constructor so we can get file locations from the context
- // installUpdates();
//verifyWrapperConfig();
Router r = new Router();
if ( (args != null) && (args.length == 1) && ("rebuild".equals(args[0])) ) {
r.rebuildNewIdentity();
} else {
+ // This is here so that we can get the directory location from the context
+ // for the zip file and the base location to unzip to.
+ // If it does an update, it never returns.
+ // I guess it's better to have the other-router check above this, we don't want to
+ // overwrite an existing running router's jar files. Other than ours.
+ r.installUpdates();
+ // ********* Start no threads before here ********* //
r.runRouter();
}
}
@@ -1281,6 +1309,7 @@ public class Router implements RouterClock.ClockShiftListener {
private static final String DELETE_FILE = "deletelist.txt";
/**
+ * Context must be available.
* Unzip update file found in the router dir OR base dir, to the base dir
*
* If we can't write to the base dir, complain.
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index f7d70ed0a..87e5bffca 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -18,10 +18,10 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
- public final static long BUILD = 24;
+ public final static long BUILD = 1;
/** for example "-test" */
- public final static String EXTRA = "-rc";
+ public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);
diff --git a/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java b/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java
index 18612c3cd..cfcdd8a34 100644
--- a/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java
+++ b/router/java/src/net/i2p/router/networkdb/PublishLocalRouterInfoJob.java
@@ -41,7 +41,7 @@ public class PublishLocalRouterInfoJob extends JobImpl {
RouterInfo ri = new RouterInfo(getContext().router().getRouterInfo());
if (_log.shouldLog(Log.DEBUG))
_log.debug("Old routerInfo contains " + ri.getAddresses().size()
- + " addresses and " + ri.getOptions().size() + " options");
+ + " addresses and " + ri.getOptionsMap().size() + " options");
Properties stats = getContext().statPublisher().publishStatistics();
stats.setProperty(RouterInfo.PROP_NETWORK_ID, ""+Router.NETWORK_ID);
try {
@@ -60,7 +60,7 @@ public class PublishLocalRouterInfoJob extends JobImpl {
getContext().router().setRouterInfo(ri);
if (_log.shouldLog(Log.INFO))
_log.info("Newly updated routerInfo is published with " + stats.size()
- + "/" + ri.getOptions().size() + " options on "
+ + "/" + ri.getOptionsMap().size() + " options on "
+ new Date(ri.getPublished()));
try {
getContext().netDb().publish(ri);
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java
index 5c719d76c..2d2353296 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java
@@ -133,8 +133,7 @@ class FloodfillMonitorJob extends JobImpl {
if (ra == null)
happy = false;
else {
- Properties props = ra.getOptions();
- if (props == null || props.getProperty("ihost0") != null)
+ if (ra.getOption("ihost0") != null)
happy = false;
}
}
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
index 9c86b7f01..0fc4af026 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
@@ -786,8 +786,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
RouterAddress ra = routerInfo.getTargetAddress("SSU");
if (ra != null) {
// Introducers change often, introducee will ping introducer for 2 hours
- Properties props = ra.getOptions();
- if (props != null && props.getProperty("ihost0") != null)
+ if (ra.getOption("ihost0") != null)
return "Peer " + key.toBase64() + " published > 75m ago with SSU Introducers";
if (routerInfo.getTargetAddress("NTCP") == null)
return "Peer " + key.toBase64() + " published > 75m ago, SSU only without introducers";
@@ -822,10 +821,10 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
if (err != null)
throw new IllegalArgumentException("Invalid store attempt - " + err);
- if (_log.shouldLog(Log.DEBUG))
- _log.debug("RouterInfo " + key.toBase64() + " is stored with "
- + routerInfo.getOptions().size() + " options on "
- + new Date(routerInfo.getPublished()));
+ //if (_log.shouldLog(Log.DEBUG))
+ // _log.debug("RouterInfo " + key.toBase64() + " is stored with "
+ // + routerInfo.getOptionsMap().size() + " options on "
+ // + new Date(routerInfo.getPublished()));
_context.peerManager().setCapabilities(key, routerInfo.getCapabilities());
_ds.put(key, routerInfo, persist);
diff --git a/router/java/src/net/i2p/router/peermanager/PeerTestJob.java b/router/java/src/net/i2p/router/peermanager/PeerTestJob.java
index ab3f2542e..241fd8bb4 100644
--- a/router/java/src/net/i2p/router/peermanager/PeerTestJob.java
+++ b/router/java/src/net/i2p/router/peermanager/PeerTestJob.java
@@ -25,6 +25,7 @@ import net.i2p.util.Log;
* selection to the peer manager and tests the peer by sending it a useless
* database store message
*
+ * TODO - What's the point? Disable this? See also notes in PeerManager.selectPeers()
*/
public class PeerTestJob extends JobImpl {
private final Log _log;
@@ -65,7 +66,8 @@ public class PeerTestJob extends JobImpl {
_log.info("Stop testing peers");
}
- public String getName() { return "Initiate some peer tests"; }
+ public String getName() { return "Peer test start"; }
+
public void runJob() {
if (!_keepTesting) return;
Set peers = selectPeersToTest();
diff --git a/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java b/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
index 093ca8ed2..8b14d22a0 100644
--- a/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
+++ b/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
@@ -701,8 +701,7 @@ public class ProfileOrganizer {
continue;
}
// This is the quick way of doing UDPAddress.getIntroducerCount() > 0
- Properties props = ra.getOptions();
- if (props != null && props.getProperty("ihost0") != null)
+ if (ra.getOption("ihost0") != null)
l.add(peer);
}
}
@@ -1263,9 +1262,7 @@ public class ProfileOrganizer {
if (paddr == null)
return rv;
for (RouterAddress pa : paddr) {
- Properties pprops = pa.getOptions();
- if (pprops == null) continue;
- String phost = pprops.getProperty("host");
+ String phost = pa.getOption("host");
if (phost == null) continue;
InetAddress pi;
try {
diff --git a/router/java/src/net/i2p/router/startup/BootCommSystemJob.java b/router/java/src/net/i2p/router/startup/BootCommSystemJob.java
index 52cae334a..c6bd62c76 100644
--- a/router/java/src/net/i2p/router/startup/BootCommSystemJob.java
+++ b/router/java/src/net/i2p/router/startup/BootCommSystemJob.java
@@ -12,6 +12,7 @@ import net.i2p.router.Job;
import net.i2p.router.JobImpl;
import net.i2p.router.RouterContext;
import net.i2p.router.RouterClock;
+import net.i2p.router.tasks.ReadConfigJob;
import net.i2p.util.Log;
/** This actually boots almost everything */
diff --git a/router/java/src/net/i2p/router/startup/ReadConfigJob.java b/router/java/src/net/i2p/router/tasks/ReadConfigJob.java
similarity index 98%
rename from router/java/src/net/i2p/router/startup/ReadConfigJob.java
rename to router/java/src/net/i2p/router/tasks/ReadConfigJob.java
index fdba0678d..b11ce861f 100644
--- a/router/java/src/net/i2p/router/startup/ReadConfigJob.java
+++ b/router/java/src/net/i2p/router/tasks/ReadConfigJob.java
@@ -1,4 +1,4 @@
-package net.i2p.router.startup;
+package net.i2p.router.tasks;
/*
* free (adj.): unencumbered; not under the control of others
* Written by jrandom in 2003 and released into the public domain
diff --git a/router/java/src/net/i2p/router/tasks/ShutdownHook.java b/router/java/src/net/i2p/router/tasks/ShutdownHook.java
index 9bc57d643..ae8e38d7a 100644
--- a/router/java/src/net/i2p/router/tasks/ShutdownHook.java
+++ b/router/java/src/net/i2p/router/tasks/ShutdownHook.java
@@ -32,6 +32,10 @@ public class ShutdownHook extends Thread {
setName("Router " + _id + " shutdown");
Log l = _context.logManager().getLog(Router.class);
l.log(Log.CRIT, "Shutting down the router...");
+ // Needed to make the wrapper happy, otherwise it gets confused
+ // and thinks we haven't shut down, possibly because it
+ // prevents other shutdown hooks from running
+ _context.router().setKillVMOnEnd(false);
_context.router().shutdown2(Router.EXIT_HARD);
}
}
diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
index d353a61a0..f4ddab5e4 100644
--- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
+++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
@@ -266,24 +266,17 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
NTCPTransport t = (NTCPTransport) _manager.getTransport(NTCPTransport.STYLE);
if (t == null)
return;
- Properties UDPProps = UDPAddr.getOptions();
- if (UDPProps == null)
- return;
- Properties newProps;
RouterAddress oldAddr = t.getCurrentAddress();
if (_log.shouldLog(Log.INFO))
_log.info("Changing NTCP Address? was " + oldAddr);
- RouterAddress newAddr = oldAddr;
- if (newAddr == null) {
- newAddr = new RouterAddress();
+ RouterAddress newAddr = new RouterAddress();
+ newAddr.setTransportStyle(NTCPTransport.STYLE);
+ Properties newProps = new Properties();
+ if (oldAddr == null) {
newAddr.setCost(NTCPAddress.DEFAULT_COST);
- newAddr.setExpiration(null);
- newAddr.setTransportStyle(NTCPTransport.STYLE);
- newProps = new Properties();
} else {
- newProps = newAddr.getOptions();
- if (newProps == null)
- newProps = new Properties();
+ newAddr.setCost(oldAddr.getCost());
+ newProps.putAll(oldAddr.getOptionsMap());
}
boolean changed = false;
@@ -297,7 +290,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
if (cport != null && cport.length() > 0) {
nport = cport;
} else if (_context.getBooleanPropertyDefaultTrue(PROP_I2NP_NTCP_AUTO_PORT)) {
- nport = UDPProps.getProperty(UDPAddress.PROP_PORT);
+ nport = UDPAddr.getOption(UDPAddress.PROP_PORT);
}
if (_log.shouldLog(Log.INFO))
_log.info("old: " + oport + " config: " + cport + " new: " + nport);
@@ -330,7 +323,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
_log.info("old: " + ohost + " config: " + name + " auto: " + enabled + " status: " + status);
if (enabled.equals("always") ||
(Boolean.valueOf(enabled).booleanValue() && status == STATUS_OK)) {
- String nhost = UDPProps.getProperty(UDPAddress.PROP_HOST);
+ String nhost = UDPAddr.getOption(UDPAddress.PROP_HOST);
if (_log.shouldLog(Log.INFO))
_log.info("old: " + ohost + " config: " + name + " new: " + nhost);
if (nhost == null || nhost.length() <= 0)
@@ -483,10 +476,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
RouterAddress ra = ri.getTargetAddress("SSU");
if (ra == null)
return null;
- Properties props = ra.getOptions();
- if (props == null)
- return null;
- return props.getProperty("host");
+ return ra.getOption("host");
}
/** full name for a country code, or the code if we don't know the name */
diff --git a/router/java/src/net/i2p/router/transport/TransportManager.java b/router/java/src/net/i2p/router/transport/TransportManager.java
index ae4bfe224..8b6b29713 100644
--- a/router/java/src/net/i2p/router/transport/TransportManager.java
+++ b/router/java/src/net/i2p/router/transport/TransportManager.java
@@ -343,15 +343,12 @@ public class TransportManager implements TransportEventListener {
for (Transport t : _transports.values()) {
int port = t.getRequestedPort();
if (t.getCurrentAddress() != null) {
- Properties opts = t.getCurrentAddress().getOptions();
- if (opts != null) {
- String s = opts.getProperty("port");
+ String s = t.getCurrentAddress().getOption("port");
if (s != null) {
try {
port = Integer.parseInt(s);
} catch (NumberFormatException nfe) {}
}
- }
}
// Use UDP port for NTCP too - see comment in NTCPTransport.getRequestedPort() for why this is here
if (t.getStyle().equals(NTCPTransport.STYLE) && port <= 0 &&
diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPAddress.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPAddress.java
index e13bcc31c..acced89f4 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/NTCPAddress.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPAddress.java
@@ -57,13 +57,13 @@ public class NTCPAddress {
_port = -1;
return;
}
- String host = addr.getOptions().getProperty(PROP_HOST);
+ String host = addr.getOption(PROP_HOST);
if (host == null) {
_host = null;
_port = -1;
} else {
_host = host.trim();
- String port = addr.getOptions().getProperty(PROP_PORT);
+ String port = addr.getOption(PROP_PORT);
if ( (port != null) && (port.trim().length() > 0) && !("null".equals(port)) ) {
try {
_port = Integer.parseInt(port.trim());
@@ -156,9 +156,7 @@ public class NTCPAddress {
public boolean equals(RouterAddress addr) {
if (addr == null) return false;
- Properties opts = addr.getOptions();
- if (opts == null) return false;
- return ( (_host.equals(opts.getProperty(PROP_HOST))) &&
- (Integer.toString(_port).equals(opts.getProperty(PROP_PORT))) );
+ return ( (_host.equals(addr.getOption(PROP_HOST))) &&
+ (Integer.toString(_port).equals(addr.getOption(PROP_PORT))) );
}
}
diff --git a/router/java/src/net/i2p/router/transport/udp/UDPAddress.java b/router/java/src/net/i2p/router/transport/udp/UDPAddress.java
index bcee07605..7fa6060db 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPAddress.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPAddress.java
@@ -64,31 +64,30 @@ public class UDPAddress {
private void parse(RouterAddress addr) {
if (addr == null) return;
- Properties opts = addr.getOptions();
- _host = opts.getProperty(PROP_HOST);
+ _host = addr.getOption(PROP_HOST);
if (_host != null) _host = _host.trim();
try {
- String port = opts.getProperty(PROP_PORT);
+ String port = addr.getOption(PROP_PORT);
if (port != null)
_port = Integer.parseInt(port);
} catch (NumberFormatException nfe) {
_port = -1;
}
- String key = opts.getProperty(PROP_INTRO_KEY);
+ String key = addr.getOption(PROP_INTRO_KEY);
if (key != null)
_introKey = Base64.decode(key.trim());
for (int i = MAX_INTRODUCERS; i >= 0; i--) {
- String host = opts.getProperty(PROP_INTRO_HOST_PREFIX + i);
+ String host = addr.getOption(PROP_INTRO_HOST_PREFIX + i);
if (host == null) continue;
- String port = opts.getProperty(PROP_INTRO_PORT_PREFIX + i);
+ String port = addr.getOption(PROP_INTRO_PORT_PREFIX + i);
if (port == null) continue;
- String k = opts.getProperty(PROP_INTRO_KEY_PREFIX + i);
+ String k = addr.getOption(PROP_INTRO_KEY_PREFIX + i);
if (k == null) continue;
byte ikey[] = Base64.decode(k);
if ( (ikey == null) || (ikey.length != SessionKey.KEYSIZE_BYTES) )
continue;
- String t = opts.getProperty(PROP_INTRO_TAG_PREFIX + i);
+ String t = addr.getOption(PROP_INTRO_TAG_PREFIX + i);
if (t == null) continue;
int p = -1;
try {