diff --git a/apps/desktopgui/src/router/configuration/PeerHelper.java b/apps/desktopgui/src/router/configuration/PeerHelper.java
index 54d71cbc2..76ffeef87 100644
--- a/apps/desktopgui/src/router/configuration/PeerHelper.java
+++ b/apps/desktopgui/src/router/configuration/PeerHelper.java
@@ -49,7 +49,7 @@ public class PeerHelper {
return "ERROR: The UDP port is already in use. Set i2np.udp.internalPort=xxxx to a different value in the advanced config and restart";
case CommSystemFacade.STATUS_UNKNOWN: // fallthrough
default:
- ra = context.router().getRouterInfo().getTargetAddress("UDP");
+ ra = context.router().getRouterInfo().getTargetAddress("SSU");
if (ra == null && context.router().getUptime() > 5*60*1000) {
if (context.getProperty(PROP_I2NP_NTCP_HOSTNAME) == null ||
context.getProperty(PROP_I2NP_NTCP_PORT) == null)
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
index 12931f3a2..36edc0766 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
@@ -39,7 +39,7 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
return;
}
- StringTokenizer tok = new StringTokenizer(destinations, ",");
+ StringTokenizer tok = new StringTokenizer(destinations, ", ");
dests = new ArrayList(1);
while (tok.hasMoreTokens()) {
String destination = tok.nextToken();
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
index c4eafde50..3c571857a 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
@@ -345,7 +345,9 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
public I2PSocket createI2PSocket(Destination dest) throws I2PException, ConnectException, NoRouteToHostException, InterruptedIOException {
if (sockMgr == null) {
// we need this before getDefaultOptions()
- sockMgr = getSocketManager();
+ synchronized(sockLock) {
+ sockMgr = getSocketManager();
+ }
}
return createI2PSocket(dest, getDefaultOptions());
}
@@ -369,9 +371,12 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
if (sockMgr == null) {
// delayed open - call get instead of build because the locking is up there
- sockMgr = getSocketManager();
- } else if (Boolean.valueOf(getTunnel().getClientOptions().getProperty("i2cp.newDestOnResume")).booleanValue()) {
- synchronized(sockMgr) {
+ synchronized(sockLock) {
+ sockMgr = getSocketManager();
+ }
+ } else if (Boolean.valueOf(getTunnel().getClientOptions().getProperty("i2cp.closeOnIdle")).booleanValue() &&
+ Boolean.valueOf(getTunnel().getClientOptions().getProperty("i2cp.newDestOnResume")).booleanValue()) {
+ synchronized(sockLock) {
I2PSocketManager oldSockMgr = sockMgr;
// This will build a new socket manager and a new dest if the session is closed.
sockMgr = getSocketManager();
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
index 53c3136b2..316731dee 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
@@ -211,8 +211,11 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
if (!defaultOpts.contains("i2p.streaming.inactivityTimeout"))
defaultOpts.setProperty("i2p.streaming.inactivityTimeout", ""+DEFAULT_READ_TIMEOUT);
// delayed start
- if (sockMgr == null)
- sockMgr = getSocketManager();
+ if (sockMgr == null) {
+ synchronized(sockLock) {
+ sockMgr = getSocketManager();
+ }
+ }
I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts);
if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT))
opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java
index a029de725..d606467c5 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java
@@ -153,7 +153,9 @@ public class EditBean extends IndexBean {
}
public boolean getNewDest(int tunnel) {
- return getBooleanProperty(tunnel, "i2cp.newDestOnResume");
+ return getBooleanProperty(tunnel, "i2cp.newDestOnResume") &&
+ getBooleanProperty(tunnel, "i2cp.closeOnIdle") &&
+ !getBooleanProperty(tunnel, "persistentClientKey");
}
public boolean getPersistentClientKey(int tunnel) {
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
index 8663d35fe..f85d8dc93 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
@@ -135,7 +135,7 @@ public class SummaryHelper extends HelperBase {
return "ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart";
case CommSystemFacade.STATUS_UNKNOWN: // fallthrough
default:
- ra = _context.router().getRouterInfo().getTargetAddress("UDP");
+ ra = _context.router().getRouterInfo().getTargetAddress("SSU");
if (ra == null && _context.router().getUptime() > 5*60*1000) {
if (_context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_HOSTNAME) == null ||
_context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_PORT) == null)
diff --git a/apps/routerconsole/jsp/logs.jsp b/apps/routerconsole/jsp/logs.jsp
index a10291248..dbaca0403 100644
--- a/apps/routerconsole/jsp/logs.jsp
+++ b/apps/routerconsole/jsp/logs.jsp
@@ -17,6 +17,8 @@
I2P
<%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%>
<%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%>
+CPU <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)
+jbigi <%=net.i2p.util.NativeBigInteger.loadStatus()%>
Compare the BigInteger.modPow/doubleValue vs the NativeBigInteger.modPow/doubleValue of some * really big (2Kbit) numbers 100 different times and benchmark the @@ -455,12 +474,14 @@ public class NativeBigInteger extends BigInteger { if(_doLog) System.err.println("INFO: " + s); I2PAppContext.getGlobalContext().logManager().getLog(NativeBigInteger.class).info(s); + _loadStatus = s; } private static void warn(String s) { if(_doLog) System.err.println("WARNING: " + s); I2PAppContext.getGlobalContext().logManager().getLog(NativeBigInteger.class).warn(s); + _loadStatus = s; } /** diff --git a/core/java/src/net/i2p/util/ShellCommand.java b/core/java/src/net/i2p/util/ShellCommand.java index 36f0dfd21..80bdc32f6 100644 --- a/core/java/src/net/i2p/util/ShellCommand.java +++ b/core/java/src/net/i2p/util/ShellCommand.java @@ -34,6 +34,7 @@ public class ShellCommand { private static final boolean NO_WAIT_FOR_EXIT_STATUS = false; private boolean _commandSuccessful; + private boolean _commandCompleted; private CommandThread _commandThread; private InputStream _errorStream; private InputStream _inputStream; @@ -43,6 +44,8 @@ public class ShellCommand { /** * Executes a shell command in its own thread. + * Use caution when repeatedly calling execute methods with the same object + * as there are some globals here... * * @author hypercubus */ @@ -57,11 +60,16 @@ public class ShellCommand { this.caller = caller; this.shellCommand = shellCommand; this.consumeOutput = consumeOutput; + _commandSuccessful = false; + _commandCompleted = false; } @Override public void run() { + // FIXME these will corrupt the globals if the command times out and the caller + // makes another request with the same object. _commandSuccessful = execute(shellCommand, consumeOutput, WAIT_FOR_EXIT_STATUS); + _commandCompleted = true; if (_isTimerRunning) { synchronized(caller) { caller.notifyAll(); // In case the caller is still in the wait() state. @@ -248,7 +256,8 @@ public class ShellCommand { _isTimerRunning = true; wait(seconds * 1000); _isTimerRunning = false; - return true; + if (!_commandCompleted) + return true; } } catch (InterruptedException e) { @@ -317,7 +326,8 @@ public class ShellCommand { _isTimerRunning = true; wait(seconds * 1000); _isTimerRunning = false; - return true; + if (!_commandCompleted) + return true; } } catch (InterruptedException e) { diff --git a/installer/resources/clients.config b/installer/resources/clients.config index 9d0c1b583..170f4c8fe 100644 --- a/installer/resources/clients.config +++ b/installer/resources/clients.config @@ -28,7 +28,7 @@ clientApp.3.startOnLoad=true clientApp.4.main=net.i2p.apps.systray.UrlLauncher clientApp.4.name=consoleBrowser clientApp.4.args=http://127.0.0.1:7657/index.jsp -clientApp.4.delay=5 +clientApp.4.delay=15 clientApp.4.startOnLoad=true # BOB bridge diff --git a/router/java/src/net/i2p/router/client/CreateSessionJob.java b/router/java/src/net/i2p/router/client/CreateSessionJob.java index 11608980d..0ee1f177f 100644 --- a/router/java/src/net/i2p/router/client/CreateSessionJob.java +++ b/router/java/src/net/i2p/router/client/CreateSessionJob.java @@ -59,10 +59,10 @@ class CreateSessionJob extends JobImpl { // XXX props.putAll(Router.getInstance().getConfigMap()); // override them by the client's settings - props.putAll(_runner.getConfig().getOptions()); + props.putAll(cfg.getOptions()); // and load 'em up (using anything not yet set as the software defaults) settings.readFromProperties(props); - getContext().tunnelManager().buildTunnels(_runner.getConfig().getDestination(), settings); + getContext().tunnelManager().buildTunnels(cfg.getDestination(), settings); } }