mirror of
https://github.com/i2p/i2p.i2p.git
synced 2024-12-06 19:27:00 +01:00
SSU2: Enable for Android, ARM, and 2% of others
This commit is contained in:
@@ -18,10 +18,10 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Git";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 14;
|
||||
public final static long BUILD = 15;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
public final static String EXTRA = "-rc";
|
||||
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + FULL_VERSION);
|
||||
|
||||
@@ -87,6 +87,8 @@ public class TransportManager implements TransportEventListener {
|
||||
* @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 */
|
||||
@@ -259,7 +261,18 @@ public class TransportManager implements TransportEventListener {
|
||||
private void configTransports() {
|
||||
Transport udp = null;
|
||||
if (_enableUDP) {
|
||||
X25519KeyFactory xdh = _context.getBooleanProperty(PROP_ENABLE_SSU2) ? _xdhThread : null;
|
||||
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);
|
||||
}
|
||||
X25519KeyFactory xdh = enableSSU2 ? _xdhThread : null;
|
||||
udp = new UDPTransport(_context, _dhThread, xdh);
|
||||
addTransport(udp);
|
||||
initializeAddress(udp);
|
||||
|
||||
Reference in New Issue
Block a user