2007-02-13 jrandom

* Tell our peers about who we know in the floodfill netDb every
      6 hours or so, mitigating the situation where peers lose track
      of floodfill routers.
    * Disable the Syndie updater (people should use the new Syndie,
      not this one)
    * Disable the eepsite tunnel by default
This commit is contained in:
jrandom
2007-02-14 04:33:36 +00:00
committed by zzz
parent f4beebe60d
commit 809f3e847b
9 changed files with 54 additions and 16 deletions

View File

@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.483 $ $Date: 2007-01-29 23:05:21 $";
public final static String ID = "$Revision: 1.484 $ $Date: 2007-01-30 03:58:19 $";
public final static String VERSION = "0.6.1.26";
public final static long BUILD = 17;
public final static long BUILD = 18;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@@ -227,7 +227,7 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
}
/** list of the Hashes of currently known floodfill peers */
List getFloodfillPeers() {
public List getFloodfillPeers() {
FloodfillPeerSelector sel = (FloodfillPeerSelector)getPeerSelector();
return sel.selectFloodfillParticipants(getKBuckets());
}

View File

@@ -11,6 +11,7 @@ import java.util.*;
import java.util.zip.Adler32;
import net.i2p.data.Base64;
import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
import net.i2p.data.RouterIdentity;
import net.i2p.data.RouterInfo;
import net.i2p.data.SessionKey;
@@ -21,6 +22,7 @@ import net.i2p.data.i2np.I2NPMessageHandler;
import net.i2p.router.OutNetMessage;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
import net.i2p.router.transport.FIFOBandwidthLimiter;
import net.i2p.util.Log;
@@ -350,6 +352,8 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
infoMsg.beginSend();
_context.statManager().addRateData("ntcp.infoMessageEnqueued", 1, 0);
send(infoMsg);
enqueueFloodfillMessage(target);
} else {
if (_isInbound) {
// ok, we shouldn't have enqueued it yet, as we havent received their info
@@ -358,6 +362,36 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
}
}
}
/**
* to prevent people from losing track of the floodfill peers completely, lets periodically
* send those we are connected to references to the floodfill peers that we know
*/
private void enqueueFloodfillMessage(RouterInfo target) {
FloodfillNetworkDatabaseFacade fac = (FloodfillNetworkDatabaseFacade)_context.netDb();
List peers = fac.getFloodfillPeers();
for (int i = 0; i < peers.size(); i++) {
Hash peer = (Hash)peers.get(i);
// we already sent our own info, and no need to tell them about themselves
if (peer.equals(_context.routerHash()) || peer.equals(target.calculateHash()))
continue;
RouterInfo info = fac.lookupRouterInfoLocally(peer);
OutNetMessage infoMsg = new OutNetMessage(_context);
infoMsg.setExpiration(_context.clock().now()+10*1000);
DatabaseStoreMessage dsm = new DatabaseStoreMessage(_context);
dsm.setKey(peer);
dsm.setRouterInfo(info);
infoMsg.setMessage(dsm);
infoMsg.setPriority(100);
infoMsg.setTarget(target);
infoMsg.beginSend();
_context.statManager().addRateData("ntcp.floodInfoMessageEnqueued", 1, 0);
send(infoMsg);
}
}
/**
* @param clockSkew alice's clock minus bob's clock in seconds (may be negative, obviously, but |val| should

View File

@@ -87,6 +87,7 @@ public class NTCPTransport extends TransportImpl {
_context.statManager().createRateStat("ntcp.inboundEstablished", "", "ntcp", new long[] { 60*1000, 10*60*1000 });
_context.statManager().createRateStat("ntcp.inboundEstablishedDuplicate", "", "ntcp", new long[] { 60*1000, 10*60*1000 });
_context.statManager().createRateStat("ntcp.infoMessageEnqueued", "", "ntcp", new long[] { 60*1000, 10*60*1000 });
_context.statManager().createRateStat("ntcp.floodInfoMessageEnqueued", "", "ntcp", new long[] { 60*1000, 10*60*1000 });
_context.statManager().createRateStat("ntcp.invalidDH", "", "ntcp", new long[] { 60*1000, 10*60*1000 });
_context.statManager().createRateStat("ntcp.invalidHXY", "", "ntcp", new long[] { 60*1000, 10*60*1000 });
_context.statManager().createRateStat("ntcp.invalidHXxorBIH", "", "ntcp", new long[] { 60*1000, 10*60*1000 });