forked from I2P_Developers/i2p.i2p
SSU2: Enable by default
This commit is contained in:
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Git";
|
||||
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 = "";
|
||||
|
||||
@@ -84,11 +84,10 @@ public class TransportManager implements TransportEventListener {
|
||||
/** default true */
|
||||
public final static String PROP_ENABLE_UDP = "i2np.udp.enable";
|
||||
/**
|
||||
* Default true as of 0.9.56
|
||||
* @since 0.9.54
|
||||
*/
|
||||
public final static String PROP_ENABLE_SSU2 = "i2np.ssu2.enable";
|
||||
/** 1 in this many */
|
||||
private static final int SSU2_ENABLE_PROBABILITY = 50;
|
||||
/** default true */
|
||||
public final static String PROP_ENABLE_NTCP = "i2np.ntcp.enable";
|
||||
/** default true */
|
||||
@@ -261,17 +260,7 @@ public class TransportManager implements TransportEventListener {
|
||||
private void configTransports() {
|
||||
Transport udp = null;
|
||||
if (_enableUDP) {
|
||||
String ssu2 = _context.getProperty(PROP_ENABLE_SSU2);
|
||||
boolean enableSSU2 = false;
|
||||
if (ssu2 == null) {
|
||||
// Migration, to be removed when we change to default true
|
||||
if (SystemVersion.isSlow() || _context.random().nextInt(SSU2_ENABLE_PROBABILITY) == 0) {
|
||||
enableSSU2 = true;
|
||||
_context.router().saveConfig(PROP_ENABLE_SSU2, "true");
|
||||
}
|
||||
} else {
|
||||
enableSSU2 = Boolean.parseBoolean(ssu2);
|
||||
}
|
||||
boolean enableSSU2 = _context.getBooleanPropertyDefaultTrue(PROP_ENABLE_SSU2);
|
||||
X25519KeyFactory xdh = enableSSU2 ? _xdhThread : null;
|
||||
udp = new UDPTransport(_context, _dhThread, xdh);
|
||||
addTransport(udp);
|
||||
|
||||
Reference in New Issue
Block a user