diff --git a/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java b/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java index cb09a1e5eb048bf50c03cb42d99aec5bbb993093..ea372ec5c86bcac80c854f8e33ad201771dab30d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java @@ -19,6 +19,8 @@ import java.util.concurrent.ConcurrentHashMap; import net.i2p.CoreVersion; import net.i2p.I2PAppContext; +import net.i2p.app.ClientApp; +import net.i2p.app.ClientAppState; import net.i2p.data.DataHelper; import net.i2p.router.RouterContext; import net.i2p.router.RouterVersion; @@ -602,6 +604,20 @@ public class PluginStarter implements Runnable { _pendingPluginClients.put(pluginName, new ConcurrentHashSet<SimpleTimer2.TimedEvent>()); for(ClientAppConfig app : apps) { + // If the client is a running ClientApp that we want to stop, + // bypass all the logic below. + ClientApp ca = ctx.routerAppManager().getClientApp(app.className, LoadClientAppsJob.parseArgs(app.args)); + if (ca != null && ca.getState() == ClientAppState.RUNNING) { + if (action.equals("stop")) { + try { + ca.shutdown(LoadClientAppsJob.parseArgs(app.stopargs)); + } catch (Throwable t) { + throw new Exception(t); + } + continue; + } + } + if (action.equals("start") && app.disabled) continue; String argVal[]; diff --git a/history.txt b/history.txt index afddf70d067bc01759d1336c53f982f68790147a..3f4932e98b19b9d6bbab676421c7453c1d4b93d3 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2014-03-23 str4d + * Console: Handle stopping plugin ClientApps + 2014-03-16 zzz * SSU: Fix corruption of introducer keys