forked from I2P_Developers/i2p.i2p
Compare commits
7 Commits
i2p.i2p.2.
...
i2p.i2p.2.
Author | SHA1 | Date | |
---|---|---|---|
67266e5ee8 | |||
b2fea266ee | |||
c30ad8d386 | |||
3ce34ed338 | |||
f3794ecd10 | |||
0bb220b85d | |||
badcf76e2f |
@ -8,8 +8,6 @@ import java.util.Properties;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.app.MenuCallback;
|
||||
import net.i2p.app.MenuHandle;
|
||||
import net.i2p.apps.systray.UrlLauncher;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.desktopgui.ExternalMain;
|
||||
@ -135,22 +133,9 @@ public class RunStandalone {
|
||||
System.setProperty("java.awt.headless", "false");
|
||||
ExternalMain dtg = new ExternalMain(_context, _context.clientAppManager(), null);
|
||||
dtg.startup();
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ie) {}
|
||||
Callback cb = new Callback();
|
||||
MenuHandle mh = dtg.addMenu("i2psnark is running", cb);
|
||||
if (mh == null)
|
||||
System.out.println("addMenu failed!");
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static class Callback implements MenuCallback {
|
||||
public void clicked(MenuHandle handle) {
|
||||
System.out.println("Clicked! " + handle.getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,10 @@ public class BuildTime {
|
||||
private static final long _latestTime;
|
||||
private static final long YEARS_25 = 25L*365*24*60*60*1000;
|
||||
/** update this periodically */
|
||||
private static final String EARLIEST = "2023-01-01 12:00:00 UTC";
|
||||
private static final String EARLIEST = "2023-06-14 12:00:00 UTC";
|
||||
// fallback if parse fails ticket #1976
|
||||
// date -d 202x-xx-xx +%s
|
||||
private static final long EARLIEST_LONG = 1672531200 * 1000L;
|
||||
private static final long EARLIEST_LONG = 1686700800 * 1000L;
|
||||
|
||||
static {
|
||||
// this is the standard format of build.timestamp as set in the top-level build.xml
|
||||
|
Binary file not shown.
@ -8,6 +8,7 @@ import java.util.Properties;
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.data.SessionKey;
|
||||
import net.i2p.data.i2np.I2NPMessage;
|
||||
import net.i2p.util.ConcurrentHashSet;
|
||||
import net.i2p.util.NativeBigInteger;
|
||||
import net.i2p.util.RandomSource;
|
||||
@ -118,7 +119,7 @@ public class TunnelPoolSettings {
|
||||
_IPRestriction = DEFAULT_IP_RESTRICTION;
|
||||
_unknownOptions = new Properties();
|
||||
_randomKey = generateRandomKey();
|
||||
_msgIDBloomXor = RandomSource.getInstance().nextLong();
|
||||
_msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
|
||||
if (_isExploratory && !_isInbound)
|
||||
_priority = EXPLORATORY_PRIORITY;
|
||||
|
@ -34,9 +34,9 @@ public class GarlicMessageHandler implements HandlerJobBuilder {
|
||||
|
||||
public GarlicMessageHandler(RouterContext context) {
|
||||
_context = context;
|
||||
_msgIDBloomXorLocal = RandomSource.getInstance().nextLong();
|
||||
_msgIDBloomXorRouter = RandomSource.getInstance().nextLong();
|
||||
_msgIDBloomXorTunnel = RandomSource.getInstance().nextLong();
|
||||
_msgIDBloomXorLocal = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
_msgIDBloomXorRouter = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
_msgIDBloomXorTunnel = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
}
|
||||
|
||||
public GarlicMessageHandler(RouterContext context, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel) {
|
||||
|
@ -26,7 +26,7 @@ public class FloodfillDatabaseLookupMessageHandler implements HandlerJobBuilder
|
||||
private RouterContext _context;
|
||||
private FloodfillNetworkDatabaseFacade _facade;
|
||||
private Log _log;
|
||||
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong();
|
||||
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
|
||||
public FloodfillDatabaseLookupMessageHandler(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
|
||||
_context = context;
|
||||
|
@ -24,7 +24,7 @@ import net.i2p.util.RandomSource;
|
||||
public class FloodfillDatabaseStoreMessageHandler implements HandlerJobBuilder {
|
||||
private RouterContext _context;
|
||||
private FloodfillNetworkDatabaseFacade _facade;
|
||||
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong();
|
||||
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
|
||||
public FloodfillDatabaseStoreMessageHandler(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
|
||||
_context = context;
|
||||
|
@ -988,7 +988,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
|
||||
rv.setReceivedBy(to);
|
||||
} else if (leaseSet.getReceivedAsReply()) {
|
||||
rv.setReceivedAsReply();
|
||||
}
|
||||
} else
|
||||
if (leaseSet.getReceivedAsPublished()) {
|
||||
rv.setReceivedAsPublished(true);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import java.util.Set;
|
||||
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.data.router.RouterInfo;
|
||||
import net.i2p.data.i2np.I2NPMessage;
|
||||
import net.i2p.router.JobImpl;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.RouterContext;
|
||||
@ -59,7 +60,7 @@ class StartExplorersJob extends JobImpl {
|
||||
private static final long MAX_LAG = 100;
|
||||
private static final long MAX_MSG_DELAY = 1500;
|
||||
|
||||
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong();
|
||||
private final long _msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
|
||||
public StartExplorersJob(RouterContext context, KademliaNetworkDatabaseFacade facade) {
|
||||
super(context);
|
||||
|
@ -136,7 +136,7 @@ public class TransportManager implements TransportEventListener {
|
||||
_dhThread = (_enableUDP || enableNTCP2) ? new DHSessionKeyBuilder.PrecalcRunner(context) : null;
|
||||
// always created, even if NTCP2 is not enabled, because ratchet needs it
|
||||
_xdhThread = new X25519KeyFactory(context);
|
||||
_msgIDBloomXor = _context.random().nextLong();
|
||||
_msgIDBloomXor = _context.random().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ class InboundMessageDistributor implements GarlicMessageReceiver.CloveReceiver {
|
||||
_msgIDBloomXor = clienttps.getMsgIdBloomXor();
|
||||
} else {
|
||||
_clientNickname = "NULL/Expl";
|
||||
_msgIDBloomXor = RandomSource.getInstance().nextLong();
|
||||
_msgIDBloomXor = RandomSource.getInstance().nextLong(I2NPMessage.MAX_ID_VALUE);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Initializing null or exploratory InboundMessageDistributor");
|
||||
}
|
||||
|
Reference in New Issue
Block a user