Skip to content

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

Minor changes:

Marc Nause5603809deb86
diff --git a/source/net/yacy/utils/upnp/UPnP.java b/source/net/yacy/utils/upnp/UPnP.java
index cadf4a9c6..267a644a3 100644
--- a/source/net/yacy/utils/upnp/UPnP.java
+++ b/source/net/yacy/utils/upnp/UPnP.java
@@ -38,6 +38,11 @@ import org.bitlet.weupnp.GatewayDiscover;
import org.bitlet.weupnp.PortMappingEntry;
import org.xml.sax.SAXException;
+/**
+ * Maps port(s) in LAN to port(s) in WAN vie UPnP.
+ *
+ * @author David Wieditz, Marc Nause
+ */
public class UPnP {
private static final ConcurrentLog LOG = new ConcurrentLog("UPNP");
@@ -122,8 +127,6 @@ public class UPnP {
* Add port mapping to all gateway devices on the network.<br/>
* Latest port mapping will be removed.
*
- * TODO: don't try to map already mapped port again, find alternative
- *
* @param type
* mapping type
* @param mapping
@@ -156,7 +159,6 @@ public class UPnP {
int portCandidate = port;
while (isInUse(portCandidate) && portCandidate > 0) {
- LOG.info(portCandidate + " in use, trying different port.");
portCandidate = getNewPortCandidate(portCandidate);
}
@@ -242,7 +244,7 @@ public class UPnP {
return MAPPINGS.get(type).getPort();
}
- public static int getNewPortCandidate(final int oldCandidate) {
+ private static int getNewPortCandidate(final int oldCandidate) {
int newPortCandidate = Math.min(
Math.max(MIN_CANDIDATE_PORT, oldCandidate + 1),