forked from I2P_Developers/i2p.i2p
i2ptunnel: Don't default to a private key file that exists (ticket #1628)
Fix build.xml war dependency tracking
This commit is contained in:
@@ -235,6 +235,7 @@
|
||||
<target name="warUpToDate">
|
||||
<uptodate property="war.uptodate" targetfile="build/i2ptunnel.war" >
|
||||
<srcfiles dir= "../jsp" excludes="web.xml, web-fragment.xml, **/*.java, *.jsp" />
|
||||
<srcfiles dir= "build/obj" includes="**/ui/*.class **/web/*.class" />
|
||||
</uptodate>
|
||||
<condition property="shouldListChanges2" >
|
||||
<and>
|
||||
|
@@ -267,13 +267,21 @@ public class GeneralHelper {
|
||||
public String getPrivateKeyFile(int tunnel) {
|
||||
return getPrivateKeyFile(_group, tunnel);
|
||||
}
|
||||
public static String getPrivateKeyFile(TunnelControllerGroup tcg, int tunnel) {
|
||||
|
||||
public String getPrivateKeyFile(TunnelControllerGroup tcg, int tunnel) {
|
||||
TunnelController tun = getController(tcg, tunnel);
|
||||
if (tun != null && tun.getPrivKeyFile() != null)
|
||||
return tun.getPrivKeyFile();
|
||||
if (tunnel < 0)
|
||||
tunnel = tcg == null ? 999 : tcg.getControllers().size();
|
||||
return "i2ptunnel" + tunnel + "-privKeys.dat";
|
||||
String rv = "i2ptunnel" + tunnel + "-privKeys.dat";
|
||||
// Don't default to a file that already exists,
|
||||
// which could happen after other tunnels are deleted.
|
||||
int i = 0;
|
||||
while ((new File(_context.getConfigDir(), rv)).exists()) {
|
||||
rv = "i2ptunnel" + tunnel + '.' + (++i) + "-privKeys.dat";
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
public String getClientInterface(int tunnel) {
|
||||
|
Reference in New Issue
Block a user