From 088f9558ece4e1d8848d0551345f94873e4a4872 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 9 Oct 2009 13:56:34 +0000 Subject: [PATCH] fix persistent client key on split directories - thanks user! --- .../src/net/i2p/i2ptunnel/I2PTunnelClientBase.java | 12 +++++++++++- history.txt | 3 +++ router/java/src/net/i2p/router/RouterVersion.java | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java index 946e40430e..6a6c83883a 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java @@ -3,6 +3,7 @@ */ package net.i2p.i2ptunnel; +import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InterruptedIOException; @@ -114,7 +115,6 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna this.localPort = localPort; this.l = l; this.handlerName = handlerName + _clientId; - this.privKeyFile = pkf; _ownDest = ownDest; // == ! shared client @@ -124,6 +124,14 @@ 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 }); + // normalize path so we can find it + if (pkf != null) { + File keyFile = new File(pkf); + if (!keyFile.isAbsolute()) + keyFile = new File(_context.getConfigDir(), pkf); + this.privKeyFile = keyFile.getAbsolutePath(); + } + // no need to load the netDb with leaseSets for destinations that will never // be looked up tunnel.getClientOptions().setProperty("i2cp.dontPublishLeaseSet", "true"); @@ -277,6 +285,8 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna protected static I2PSocketManager buildSocketManager(I2PTunnel tunnel) { return buildSocketManager(tunnel, null); } + + /** @param pkf absolute path or null */ protected static I2PSocketManager buildSocketManager(I2PTunnel tunnel, String pkf) { Properties props = new Properties(); props.putAll(tunnel.getClientOptions()); diff --git a/history.txt b/history.txt index 051a753411..9e7673cb1d 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2009-10-09 zzz + * I2PTunnel: Fix persistent client tunnel keyfile location + 2009-10-07 zzz * Doc and eepsite_index updates * UDP: Remove port number from thread names diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 47f19a478e..f74ab11db2 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ 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 = 25; /** for example "-test" */ public final static String EXTRA = "-rc"; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;