* i2ptunnel: Fix updating session options on a running delay-open client tunnel

This commit is contained in:
zzz
2014-09-12 21:48:29 +00:00
parent 682534f468
commit 603b345405
3 changed files with 29 additions and 3 deletions

View File

@ -567,13 +567,35 @@ public class TunnelController implements Logging {
// tell i2ptunnel, who will tell the TunnelTask, who will tell the SocketManager // tell i2ptunnel, who will tell the TunnelTask, who will tell the SocketManager
setSessionOptions(); setSessionOptions();
if (_running && _sessions != null) {
for (I2PSession s : _sessions) { // we use the tunnel sessions, not _sessions, as
// _sessions will be null for delay-open tunnels - see acquire().
// We want the current sessions.
//List<I2PSession> sessions = _sessions;
List<I2PSession> sessions = _tunnel.getSessions();
if (_running && sessions != null) {
if (sessions.isEmpty()) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Running but no sessions to update");
}
for (I2PSession s : sessions) {
// tell the router via the session // tell the router via the session
if (!s.isClosed()) { if (!s.isClosed()) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Session is open, updating: " + s);
s.updateOptions(_tunnel.getClientOptions()); s.updateOptions(_tunnel.getClientOptions());
} else {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Session is closed, not updating: " + s);
} }
} }
} else {
if (_log.shouldLog(Log.DEBUG)) {
if (!_running)
_log.debug("Not running, not updating sessions");
if (sessions == null)
_log.debug("null sessions, nothing to update");
}
} }
} }

View File

@ -1,3 +1,7 @@
2014-09-12 zzz
* i2psnark: Escape fixes
* i2ptunnel: Fix updating session options on a running delay-open client tunnel
2014-09-09 zzz 2014-09-09 zzz
* i2psnark: Escape fixes * i2psnark: Escape fixes

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 17; public final static long BUILD = 18;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = "-rc"; public final static String EXTRA = "-rc";