Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

UPnP: map port again if we are not reachable (e.g. when router rebooted)

lotus0e5423340814
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);
}