From 0e5423340814783693b0029490876321f1291c62 Mon Sep 17 00:00:00 2001 From: lotus Date: Sun, 2 Jan 2011 21:17:21 +0000 Subject: [PATCH] UPnP: map port again if we are not reachable (e.g. when router rebooted) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7419 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/search/Switchboard.java | 3 +++ source/net/yacy/yacy.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.java index 0e307cab7..aa1dc5155 100644 --- a/source/de/anomic/search/Switchboard.java +++ b/source/de/anomic/search/Switchboard.java @@ -1671,6 +1671,9 @@ public final class Switchboard extends serverSwitch { // update the cluster set this.clusterhashes = this.peers.clusterHashes(getConfig("cluster.peers.yacydomain", "")); + // check if we are reachable and try to map port again if not (e.g. when router rebooted) + if(getConfigBool(SwitchboardConstants.UPNP_ENABLED, false) && sb.peers.mySeed().isJunior()) + UPnP.addPortMapping(); // after all clean up is done, check the resource usage observer.resourceObserverJob(); diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java index c9d672fff..806e9afff 100644 --- a/source/net/yacy/yacy.java +++ b/source/net/yacy/yacy.java @@ -157,7 +157,7 @@ public final class yacy { try { "a".codePointAt(0); // needs at least Java 1.5 } catch (final NoSuchMethodError e) { - System.err.println("STARTUP: Java Version too low. You need at least Java 1.5 to run YaCy"); + System.err.println("STARTUP: Java Version too low. You need at least Java 1.5 to run YaCy"); // TODO: is 1.6 now Thread.sleep(3000); System.exit(-1); }