refactoring

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5703 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 16 years ago
parent f35dc11dc4
commit 9f7e62e900

@ -43,7 +43,7 @@ import de.anomic.plasma.plasmaSwitchboardConstants;
public class UPnP {
public final static Log log = new Log("UPNP");
private static plasmaSwitchboard sb;
private static plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
private final static int discoveryTimeout = 5000; // seconds to receive a response from devices
private static InternetGatewayDevice[] IGDs = null;
@ -60,10 +60,6 @@ public class UPnP {
System.setProperty("net.sbbi.upnp.ddos.matchip", "false");
} */
public static void setSb(plasmaSwitchboard switchboard) {
sb = switchboard;
}
public static boolean setIGDs(InternetGatewayDevice[] igds) {
if(IGDs == null) {
IGDs = igds; // set only once to prevent many same devices by advertisement events
@ -203,7 +199,7 @@ public class UPnP {
log.logInfo("discovered device: " + newIGD[0].getIGDRootDevice().getFriendlyName());
if (UPnP.setIGDs(newIGD) &&
plasmaSwitchboard.getSwitchboard().getConfigBool(plasmaSwitchboardConstants.UPNP_ENABLED, false))
UPnP.addPortMapping();
UPnP.addPortMapping();
Listener.unregister();
}

@ -264,7 +264,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
if (applyPro) this.log.logInfo("This is the pro-version of YaCy");
// UPnP port mapping
UPnP.setSb(sb);
if (getConfigBool(plasmaSwitchboardConstants.UPNP_ENABLED, false))
serverInstantBusyThread.oneTimeJob(UPnP.class, "addPortMapping", UPnP.log, 0);

Loading…
Cancel
Save