--- freenet/node/useralerts/PeerManagerUserAlert.java Tue Jan 20 07:26:36 1970
+++ freenet/node/useralerts/PeerManagerUserAlert.java Tue Jan 20 07:26:36 1970
@@ -40,7 +40,7 @@
public static final int MIN_CONN_ALERT_THRESHOLD = 3;
/** How many connected peers we can have without getting alerted about too many */
- public static final int MAX_CONN_ALERT_THRESHOLD = 40;
+ public static final int MAX_CONN_ALERT_THRESHOLD = 200;
/** How many disconnected peers we can have without getting alerted about too many */
public static final int MAX_DISCONN_PEER_ALERT_THRESHOLD = 50;
@@ -55,7 +55,7 @@
public static final int MIN_CONN_ERROR_ALERT_THRESHOLD = 5;
/** How many peers we can have without getting alerted about too many */
- public static final int MAX_PEER_ALERT_THRESHOLD = 100;
+ public static final int MAX_PEER_ALERT_THRESHOLD = 250;
/** How high can oldestNeverConnectedPeerAge be before we alert (in milliseconds)*/
public static final long MAX_OLDEST_NEVER_CONNECTED_PEER_AGE_ALERT_THRESHOLD = ((long) 2)*7*24*60*60*1000; // 2 weeks
--- freenet/node/LocationManager.java Tue Jan 20 07:26:36 1970
+++ freenet/node/LocationManager.java Tue Jan 20 07:26:36 1970
@@ -648,7 +648,7 @@
}
private void announceLocChange(boolean log, boolean randomReset, boolean fromDupLocation) {
- Message msg = DMT.createFNPLocChangeNotificationNew(getLocation(), node.peers.getPeerLocationDoubles(true));
+ Message msg = DMT.createFNPLocChangeNotificationNew(getLocation(), node.peers.getMaxPeerLocationDoubles(true));
node.peers.localBroadcast(msg, false, true, this);
if(log)
recordLocChange(randomReset, fromDupLocation);
--- freenet/node/OpennetManager.java Tue Jan 20 07:26:36 1970
+++ freenet/node/OpennetManager.java Tue Jan 20 07:26:36 1970
@@ -134,11 +134,12 @@
/** Constant for scaling peers: we multiply bandwidth in kB/sec by this
* and then take the square root. 12 gives 11 at 10K, 15 at 20K, 19 at
* 30K, 26 at 60K, 34 at 100K, 40 at 140K. */
- public static final double SCALING_CONSTANT = 12.0;
+ public static final double SCALING_CONSTANT = 20.0;
/** Minimum number of peers */
public static final int MIN_PEERS_FOR_SCALING = 10;
/** Maximum number of peers. */
- public static final int MAX_PEERS_FOR_SCALING = 40;
+ public static final int MAX_PEERS_FOR_SCALING = 200;
+ public static final int OLD_MAX_PEERS_FOR_SCALING = 40;
/** Maximum number of peers for purposes of FOAF attack/sanity check */
public static final int PANIC_MAX_PEERS = 50;
/** Stop trying to reconnect to an old-opennet-peer after a month. */
--- freenet/node/PeerManager.java Tue Jan 20 07:26:36 1970
+++ freenet/node/PeerManager.java Tue Jan 20 07:26:36 1970
@@ -778,6 +778,20 @@
return locs;
}
+ public double[] getMaxPeerLocationDoubles(boolean pruneBackedOffPeers) {
+ double[] locs=getPeerLocationDoubles(pruneBackedOffPeers);
+ if(locs.length>OpennetManager.OLD_MAX_PEERS_FOR_SCALING)
+ {
+ double[] newLocs = new double[OpennetManager.OLD_MAX_PEERS_FOR_SCALING];
+ System.arraycopy(locs, 0, newLocs, 0, OpennetManager.OLD_MAX_PEERS_FOR_SCALING);
+ return newLocs;
+ }
+ else
+ {
+ return locs;
+ }
+ }
+
/** Just like getPeerLocationDoubles, except it also
* returns the UID for each node. */
public LocationUIDPair[] getPeerLocationsAndUIDs() {
--- freenet/node/PeerNode.java Tue Jan 20 07:26:36 1970
+++ freenet/node/PeerNode.java Tue Jan 20 07:26:36 1970
@@ -2396,7 +2396,7 @@
protected void sendInitialMessages() {
loadSender(true).setSendASAP();
loadSender(false).setSendASAP();
- Message locMsg = DMT.createFNPLocChangeNotificationNew(node.lm.getLocation(), node.peers.getPeerLocationDoubles(true));
+ Message locMsg = DMT.createFNPLocChangeNotificationNew(node.lm.getLocation(), node.peers.getMaxPeerLocationDoubles(true));
Message ipMsg = DMT.createFNPDetectedIPAddress(detectedPeer);
Message timeMsg = DMT.createFNPTime(System.currentTimeMillis());
Message packetsMsg = createSentPacketsMessage();
--- freenet/node/RequestStarter.java Tue Jan 20 07:26:36 1970
+++ freenet/node/RequestStarter.java Tue Jan 20 07:26:36 1970
@@ -77,6 +77,9 @@
private final boolean isInsert;
private final boolean isSSK;
final boolean realTime;
+ private long lastDelay;
+ private final long a, b, c;
+