better magic

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7684 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 2700a58e5a
commit 8b95a26866

@ -51,7 +51,7 @@ public final class query {
final Switchboard sb = (Switchboard) ss;
final serverObjects prop = new serverObjects();
prop.put("magic", yacyCore.speedKey);
prop.put("magic", yacyCore.magic);
if ((post == null) || (ss == null) || !yacyNetwork.authentifyRequest(post, ss)) {
prop.put("response", "-1"); // request rejected

@ -139,7 +139,7 @@ public final class yacyClient {
// generate request
final Map<String,ContentBody> parts = yacyNetwork.basicRequestParts(Switchboard.getSwitchboard(), null, salt);
parts.put("count", UTF8.StringBody("20"));
parts.put("magic", UTF8.StringBody(Long.toString(yacyCore.speedKey)));
parts.put("magic", UTF8.StringBody(Long.toString(yacyCore.magic)));
parts.put("seed", UTF8.StringBody(mySeed.genSeedStr(salt)));
// send request
final long start = System.currentTimeMillis();

@ -70,7 +70,8 @@ public class yacyCore {
public static final Log log = new Log("YACY");
public static long lastOnlineTime = 0;
/** pseudo-random key derived from a time-interval while YaCy startup*/
public static long speedKey = System.currentTimeMillis();
public static long speedKey = 0;
public static long magic = System.currentTimeMillis();
public static final Map<String, yacyAccessible> amIAccessibleDB = new ConcurrentHashMap<String, yacyAccessible>(); // Holds PeerHash / yacyAccessible Relations
// constants for PeerPing behavior
private static final int PING_INITIAL = 10;
@ -202,7 +203,7 @@ public class yacyCore {
// returns true if we can reach ourself under our known peer address
// if we cannot reach ourself, we call a forced publishMySeed and return false
final long[] callback = yacyClient.queryUrlCount(sb.peers.mySeed());
if (callback[0] >= 0 && callback[1] == speedKey) {
if (callback[0] >= 0 && callback[1] == magic) {
sb.peers.mySeed().setLastSeenUTC();
return true;
}

Loading…
Cancel
Save