I2CP: Move the port 7654 definition

This commit is contained in:
zzz
2018-12-03 16:17:30 +00:00
parent 5e7a277e98
commit 7c5162e155
16 changed files with 27 additions and 30 deletions

View File

@ -97,7 +97,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
public boolean ownDest = false;
/** the I2CP port, non-null */
public String port = System.getProperty(I2PClient.PROP_TCP_PORT, Integer.toString(I2PSession.DEFAULT_LISTEN_PORT));
public String port = System.getProperty(I2PClient.PROP_TCP_PORT, Integer.toString(I2PClient.DEFAULT_LISTEN_PORT));
/** the I2CP host, non-null */
public String host = System.getProperty(I2PClient.PROP_TCP_HOST, "127.0.0.1");
/** the listen-on host. Sadly the listen-on port does not have a field. */

View File

@ -409,7 +409,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
Log _log = tunnel.getContext().logManager().getLog(I2PTunnelClientBase.class);
Properties props = new Properties();
props.putAll(tunnel.getClientOptions());
int portNum = I2PSession.DEFAULT_LISTEN_PORT;
int portNum = I2PClient.DEFAULT_LISTEN_PORT;
if (tunnel.port != null) {
try {
portNum = Integer.parseInt(tunnel.port);
@ -471,7 +471,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
// try to make this error sensible as it will happen...
String portNum = getTunnel().port;
if (portNum == null)
portNum = Integer.toString(I2PSession.DEFAULT_LISTEN_PORT);
portNum = Integer.toString(I2PClient.DEFAULT_LISTEN_PORT);
String msg;
if (getTunnel().getContext().isRouterContext())
msg = "Unable to build tunnels for the client";

View File

@ -210,7 +210,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
private I2PSocketManager createManager(InputStream privData) {
Properties props = new Properties();
props.putAll(getTunnel().getClientOptions());
int portNum = I2PSession.DEFAULT_LISTEN_PORT;
int portNum = I2PClient.DEFAULT_LISTEN_PORT;
if (getTunnel().port != null) {
try {
portNum = Integer.parseInt(getTunnel().port);
@ -305,7 +305,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
// try to make this error sensible as it will happen...
String portNum = getTunnel().port;
if (portNum == null)
portNum = Integer.toString(I2PSession.DEFAULT_LISTEN_PORT);
portNum = Integer.toString(I2PClient.DEFAULT_LISTEN_PORT);
String msg;
if (getTunnel().getContext().isRouterContext())
msg = "Unable to build tunnels for the server at " + remoteHost.getHostAddress() + ':' + remotePort;

View File

@ -733,10 +733,10 @@ public class TunnelController implements Logging {
int portNum = Integer.parseInt(port);
_tunnel.port = String.valueOf(portNum);
} catch (NumberFormatException nfe) {
_tunnel.port = Integer.toString(I2PSession.DEFAULT_LISTEN_PORT);
_tunnel.port = Integer.toString(I2PClient.DEFAULT_LISTEN_PORT);
}
} else {
_tunnel.port = Integer.toString(I2PSession.DEFAULT_LISTEN_PORT);
_tunnel.port = Integer.toString(I2PClient.DEFAULT_LISTEN_PORT);
}
}

View File

@ -11,7 +11,6 @@ import java.util.concurrent.ConcurrentHashMap;
import net.i2p.I2PAppContext;
import net.i2p.client.I2PClient;
import net.i2p.client.I2PSession;
import net.i2p.crypto.KeyGenerator;
import net.i2p.crypto.SigType;
import net.i2p.data.Base64;
@ -837,7 +836,7 @@ public class TunnelConfig {
if ( (_i2cpPort != null) && (_i2cpPort.trim().length() > 0) ) {
config.setProperty(TunnelController.PROP_I2CP_PORT, _i2cpPort);
} else {
config.setProperty(TunnelController.PROP_I2CP_PORT, Integer.toString(I2PSession.DEFAULT_LISTEN_PORT));
config.setProperty(TunnelController.PROP_I2CP_PORT, Integer.toString(I2PClient.DEFAULT_LISTEN_PORT));
}
}
if (_privKeyFile != null)

View File

@ -14,7 +14,7 @@ import java.util.List;
import java.util.Set;
import net.i2p.I2PException;
import net.i2p.client.I2PSession;
import net.i2p.client.I2PClient;
import net.i2p.crypto.SigType;
import net.i2p.data.Base64;
import net.i2p.data.DataHelper;
@ -447,7 +447,7 @@ public class EditBean extends IndexBean {
if (tun != null)
return tun.getI2CPPort();
else
return Integer.toString(I2PSession.DEFAULT_LISTEN_PORT);
return Integer.toString(I2PClient.DEFAULT_LISTEN_PORT);
}
public String getCustomOptions(int tunnel) {