From 09cdc0093981691e3f3923f0522220fb0ce1ba89 Mon Sep 17 00:00:00 2001 From: str4d Date: Thu, 4 Jun 2015 22:34:13 +0000 Subject: [PATCH] i2ptunnel: Don't call startup() in chained constructor (ticket #1593) --- .../src/net/i2p/i2ptunnel/I2PTunnelClientBase.java | 11 ++++++----- history.txt | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java index a2508224fa..19984db02f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java @@ -90,8 +90,11 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna public static final String PROP_USE_SSL = I2PTunnelServer.PROP_USE_SSL; /** - * This constructor always starts the tunnel (ignoring the i2cp.delayOpen option). - * It is used to add a client to an existing socket manager. + * This constructor is used to add a client to an existing socket manager. + *

+ * As of 0.9.21 this does NOT open the local socket. You MUST call + * {@link #startRunning()} for that. The local socket will be opened + * immediately (ignoring the i2cp.delayOpen option). * * @param localPort if 0, use any port, get actual port selected with getLocalPort() * @param sktMgr the existing socket manager @@ -113,8 +116,6 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna _context.statManager().createRateStat("i2ptunnel.client.manageTime", "How long it takes to accept a socket and fire it into an i2ptunnel runner (or queue it for the pool)?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 }); _context.statManager().createRateStat("i2ptunnel.client.buildRunTime", "How long it takes to run a queued socket into an i2ptunnel runner?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 }); _log = _context.logManager().getLog(getClass()); - - startup(); } /** @@ -523,7 +524,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna if (open && listenerReady) { boolean openNow = !Boolean.parseBoolean(getTunnel().getClientOptions().getProperty("i2cp.delayOpen")); - if (openNow) + if (openNow || chained) l.log("Client ready, listening on " + getTunnel().listenHost + ':' + localPort); else l.log("Client ready, listening on " + getTunnel().listenHost + ':' + localPort + ", delaying tunnel open until required"); diff --git a/history.txt b/history.txt index 3b90562608..9d3a0af95c 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,7 @@ 2015-06-04 str4d * i2ptunnel: - Don't connect manager to router in constructor (ticket #815) + - Don't call startup() in chained constructor (ticket #1593) 2015-06-03 zzz Prop from i2p.i2p.zzz.sam: