diff --git a/build.xml b/build.xml index f0c1c49739..8a6bf33d27 100644 --- a/build.xml +++ b/build.xml @@ -237,7 +237,7 @@ splitindex="true" doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}" windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}"> - + diff --git a/core/java/src/net/i2p/client/I2PSessionImpl.java b/core/java/src/net/i2p/client/I2PSessionImpl.java index 639ac5e9c6..4db4e17598 100644 --- a/core/java/src/net/i2p/client/I2PSessionImpl.java +++ b/core/java/src/net/i2p/client/I2PSessionImpl.java @@ -68,9 +68,9 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa /** currently granted lease set, or null */ private LeaseSet _leaseSet; - /** hostname of router */ + /** hostname of router - will be null if in RouterContext */ protected String _hostname; - /** port num to router */ + /** port num to router - will be 0 if in RouterContext */ protected int _portNum; /** socket for comm */ protected Socket _socket; @@ -181,15 +181,17 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa protected void loadConfig(Properties options) { _options = new Properties(); _options.putAll(filter(options)); - _hostname = _options.getProperty(I2PClient.PROP_TCP_HOST, "127.0.0.1"); - String portNum = _options.getProperty(I2PClient.PROP_TCP_PORT, LISTEN_PORT + ""); - try { - _portNum = Integer.parseInt(portNum); - } catch (NumberFormatException nfe) { - if (_log.shouldLog(Log.WARN)) - _log.warn(getPrefix() + "Invalid port number specified, defaulting to " - + LISTEN_PORT, nfe); - _portNum = LISTEN_PORT; + if (!_context.isRouterContext()) { + _hostname = _options.getProperty(I2PClient.PROP_TCP_HOST, "127.0.0.1"); + String portNum = _options.getProperty(I2PClient.PROP_TCP_PORT, LISTEN_PORT + ""); + try { + _portNum = Integer.parseInt(portNum); + } catch (NumberFormatException nfe) { + if (_log.shouldLog(Log.WARN)) + _log.warn(getPrefix() + "Invalid port number specified, defaulting to " + + LISTEN_PORT, nfe); + _portNum = LISTEN_PORT; + } } // auto-add auth if required, not set in the options, and we are in the same JVM