removed preferred IPv4 in start options and added a new field IP6 in
peer seeds which will contain one or more IPv6 addresses. Now every peer
has one or more IP addresses assigned, even several IPv6 addresses are
possible. The peer-ping process must check all given and possible IP
addresses for a backping and return the one IP which was successful when
pinging the peer. The ping-ing peer must be able to recognize which of
the given IPs are available for outside access of the peer and store
this accordingly. If only one IPv6 address is available and no IPv4,
then the IPv6 is stored in the old IP field of the seed DNA.
Many methods in Seed.java are now marked as @deprecated because they had
been used for a single IP only. There is still a large construction site
left in YaCy now where all these deprecated methods must be replaced
with new method calls. The 'extra'-IPs, used by cluster assignment had
been removed since that can be replaced with IPv6 usage in p2p clusters.
All clusters must now use IPv6 if they want an intranet-routing.
prop.put("response",1/*sb.index.fulltext().collectionSize()*/);// patched to not call collectionSize() any more because the acutal size is not needed. Instead, rwicount should be called
prop.put("response","1"/*sb.index.fulltext().collectionSize()*/);// patched to not call collectionSize() any more because the acutal size is not needed. Instead, rwicount should be called
.fine("yacyCore.publishSeedList: not necessary to publish: oldIP is equal, sizeConnected is equal and I can reach myself under the old IP.");
}
if(log.isFine())log.fine("yacyCore.publishSeedList: not necessary to publish: oldIP is equal, sizeConnected is equal and I can reach myself under the old IP.");
return;
}
@ -162,9 +158,7 @@ public class Network
if(seedUploadMethod.equals("")){
this.sb.setConfig("seedUploadMethod","none");
}
if(log.isFine()){
log.fine("yacyCore.publishSeedList: No uploading method configured");
}
if(log.isFine())log.fine("yacyCore.publishSeedList: No uploading method configured");
// a user frauds with his peer different peer hashes
if(Network.log.isFine())Network.log.fine("connect: rejecting FRAUD (double hashes "+doubleSeed.hash+"/"+seed.hash+" on same port "+seed.getPort()+") peer "+seed.getName());
@ -107,7 +108,7 @@ public class PeerActions {
}
if(Math.abs(nowUTC0Time-ctimeUTC0)/1000/60>60*6){
// the new connection is out-of-age, we reject the connection
if(Network.log.isFine())Network.log.fine("connect: rejecting out-dated peer '"+seed.getName()+"' from "+seed.getPublicAddress()+"; nowUTC0="+nowUTC0Time+", seedUTC0="+ctimeUTC0+", TimeDiff="+formatInterval(Math.abs(nowUTC0Time-ctimeUTC0)));
if(Network.log.isFine())Network.log.fine("connect: rejecting out-dated peer '"+seed.getName()+"' from "+seed.getIPs()+"; nowUTC0="+nowUTC0Time+", seedUTC0="+ctimeUTC0+", TimeDiff="+formatInterval(Math.abs(nowUTC0Time-ctimeUTC0)));
returnfalse;
}
@ -144,13 +145,13 @@ public class PeerActions {
if(!direct){
if(ctimeUTC0<dtimeUTC0){
// the disconnection was later, we reject the connection
if(Network.log.isFine())Network.log.fine("connect: rejecting disconnected peer '"+seed.getName()+"' from "+seed.getPublicAddress());
if(Network.log.isFine())Network.log.fine("connect: rejecting disconnected peer '"+seed.getName()+"' from "+seed.getIPs());
returnfalse;
}
}
// this is a return of a lost peer
if(Network.log.isFine())Network.log.fine("connect: returned KNOWN "+peerType+" peer '"+seed.getName()+"' from "+seed.getPublicAddress());
if(Network.log.isFine())Network.log.fine("connect: returned KNOWN "+peerType+" peer '"+seed.getName()+"' from "+seed.getIPs());
this.seedDB.addConnected(seed);
returntrue;
}
@ -169,10 +170,10 @@ public class PeerActions {
// TODO: update seed name lookup cache
}*/
}catch(finalNumberFormatExceptione){
if(Network.log.isFine())Network.log.fine("connect: rejecting wrong peer '"+seed.getName()+"' from "+seed.getPublicAddress()+". Cause: "+e.getMessage());
if(Network.log.isFine())Network.log.fine("connect: rejecting wrong peer '"+seed.getName()+"' from "+seed.getIPs()+". Cause: "+e.getMessage());
returnfalse;
}
if(Network.log.isFine())Network.log.fine("connect: updated KNOWN "+((direct)?"direct ":"")+peerType+" peer '"+seed.getName()+"' from "+seed.getPublicAddress());
if(Network.log.isFine())Network.log.fine("connect: updated KNOWN "+((direct)?"direct ":"")+peerType+" peer '"+seed.getName()+"' from "+seed.getIPs());
// we do this if we did not get contact with the other peer
if(Network.log.isFine())Network.log.fine("connect: no contact to a "+peer.get(Seed.PEERTYPE,Seed.PEERTYPE_VIRGIN)+" peer '"+peer.getName()+"' at "+peer.getPublicAddress()+". Cause: "+cause);
if(Network.log.isFine())Network.log.fine("connect: no contact to a "+peer.get(Seed.PEERTYPE,Seed.PEERTYPE_VIRGIN)+" peer '"+peer.getName()+"' at "+peer.getIPs()+". Cause: "+cause);
/** @return the port number of this seed or <code>-1</code> if not present */
publicfinalintgetPort(){
finalStringport=this.dna.get(Seed.PORT);
@ -662,12 +770,8 @@ public class Seed implements Cloneable, Comparable<Seed>, Comparator<Seed>
// because java thinks it must apply the UTC offset to the current time,
// to create a string that looks like our current time, it adds the local UTC offset to the
// time. To create a corrected UTC Date string, we first subtract the local UTC offset.
finalGenericFormattermy_SHORT_SECOND_FORMATTER=
newGenericFormatter(GenericFormatter.FORMAT_SHORT_SECOND,GenericFormatter.time_second);// use our own formatter to prevent concurrency locks with other processes
//System.out.println("SETTING LAST-SEEN of " + this.getName() + " to " + ls);
finalGenericFormattermy_SHORT_SECOND_FORMATTER=newGenericFormatter(GenericFormatter.FORMAT_SHORT_SECOND,GenericFormatter.time_second);// use our own formatter to prevent concurrency locks with other processes
@ -265,7 +264,7 @@ public final class Switchboard extends serverSwitch {
publicintsearchQueriesRobinsonFromLocal=0;// absolute counter of all local queries submitted on this peer from a local or autheticated used
publicintsearchQueriesRobinsonFromRemote=0;// absolute counter of all local queries submitted on this peer from a remote IP without authentication
publicfloatsearchQueriesGlobal=0f;// partial counter of remote queries (1/number-of-requested-peers)
publicSortedMap<byte[],String>clusterhashes;// map of peerhash(String)/alternative-local-address as ip:port or only ip (String) or null if address in seed should be used
publicSortedSet<byte[]>clusterhashes;// a set of cluster hashes