Author: toad
Date: 2007-10-27 20:11:08 +0000 (Sat, 27 Oct 2007)
New Revision: 15618
Modified:
trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Attempt to handshake with really old nodes
Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-10-27
20:06:47 UTC (rev 15617)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java 2007-10-27
20:11:08 UTC (rev 15618)
@@ -2388,11 +2388,10 @@
public void sendHandshake(PeerNode pn) {
int negType = pn.selectNegType(this);
if(negType == -1) {
- if(pn.isRoutingCompatible())
- Logger.error(this, "Could not negotiate with
"+pn+" : no common negTypes available!: his negTypes:
"+StringArray.toString(pn.negTypes)+" my negTypes:
"+StringArray.toString(supportedNegTypes())+" despite being up to date!!");
- else
- Logger.minor(this, "Could not negotiate with
"+pn+" : no common negTypes available!: his negTypes:
"+StringArray.toString(pn.negTypes)+" my negTypes:
"+StringArray.toString(supportedNegTypes())+" (probably just too old)");
- return;
+ // Pick a random negType from what I do support
+ int[] negTypes = supportedNegTypes();
+ negType =
negTypes[node.random.nextInt(negTypes.length)];
+ Logger.normal(this, "Cannot send handshake to "+pn+"
because no common negTypes, choosing random negType of "+negType);
}
if(logMINOR) Logger.minor(this, "Possibly sending handshake to
"+pn+" negotiation type "+negType);
DiffieHellmanContext ctx = null;