i2ptunnel: Fix dup tunnels clicking generate on new tunnel (ticket #2225)

remove dup call to processAction()
This commit is contained in:
zzz
2018-05-25 19:39:22 +00:00
parent 2fab97fb20
commit 9eb3cc5916
3 changed files with 8 additions and 6 deletions

View File

@ -267,6 +267,11 @@ public class IndexBean {
return _t("Stopping tunnel") + ' ' + getTunnelName(_tunnel) + "...";
}
/**
* Only call this ONCE! Or you will get duplicate tunnels on save.
*
* @return not HTML escaped, or "" if empty
*/
private String saveChanges() {
// FIXME name will be HTML escaped twice
return getMessages(_helper.saveTunnel(_tunnel, _config));
@ -300,7 +305,7 @@ public class IndexBean {
try {
String result = processAction();
if (result.length() > 0)
buf.append(processAction()).append('\n');
buf.append(result).append('\n');
} catch (RuntimeException e) {
_log.log(Log.CRIT, "Error processing " + _action, e);
buf.append("Error: ").append(e.toString()).append('\n');
@ -1208,12 +1213,8 @@ public class IndexBean {
/** New key */
private String generateNewEncryptionKey() {
TunnelController tun = getController(_tunnel);
Properties config = getConfig();
if (tun == null) {
// creating new
tun = new TunnelController(config, "", true);
_group.addController(tun);
saveChanges();
} else if (tun.getIsRunning() || tun.getIsStarting()) {
return "Tunnel must be stopped before modifying leaseset encryption key";
}

View File

@ -1,5 +1,6 @@
2018-05-25 zzz
* Console: Fix changes to wrong tunnel on /configtunnels (ticket #2227)
* i2ptunnel: Fix dup tunnels clicking generate on new tunnel (ticket #2225)
2018-05-06 meeh
* launchers:

View File

@ -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 = 10;
public final static long BUILD = 11;
/** for example "-test" */
public final static String EXTRA = "";