mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 19:32:56 +00:00
* UPnP:
- Fix up port handling, add some logging on bind fails
- Force IPv4 only for binds
This commit is contained in:
1 parent
3ba43a77f4
commit
31cd726b7b
4 files changed
+21
-7
No files matched your search
@@ -786,9 +786,13 @@ public class ControlPoint implements HTTPRequestListener
|
||||
HTTPServerList httpServerList = getHTTPServerList();
|
||||
while (httpServerList.open(bindPort) == false) {
|
||||
retryCnt++;
|
||||
if (UPnP.SERVER_RETRY_COUNT < retryCnt)
|
||||
if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
|
||||
Debug.warning("Failed to open HTTP event listener port " + bindPort);
|
||||
// I2P do we really need this, or can we just break ?
|
||||
return false;
|
||||
setHTTPPort(bindPort + 1);
|
||||
}
|
||||
// I2P go down not up so we don't run into other I2P things
|
||||
setHTTPPort(bindPort - 1);
|
||||
bindPort = getHTTPPort();
|
||||
}
|
||||
httpServerList.addRequestListener(this);
|
||||
@@ -799,8 +803,10 @@ public class ControlPoint implements HTTPRequestListener
|
||||
////////////////////////////////////////
|
||||
|
||||
SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
|
||||
if (ssdpNotifySocketList.open() == false)
|
||||
if (ssdpNotifySocketList.open() == false) {
|
||||
Debug.warning("Failed to open SSDP notify port 1900");
|
||||
return false;
|
||||
}
|
||||
ssdpNotifySocketList.setControlPoint(this);
|
||||
ssdpNotifySocketList.start();
|
||||
|
||||
@@ -813,9 +819,12 @@ public class ControlPoint implements HTTPRequestListener
|
||||
SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
|
||||
while (ssdpSearchResponseSocketList.open(ssdpPort) == false) {
|
||||
retryCnt++;
|
||||
if (UPnP.SERVER_RETRY_COUNT < retryCnt)
|
||||
if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
|
||||
Debug.warning("Failed to open SSDP search response port " + ssdpPort);
|
||||
return false;
|
||||
setSSDPPort(ssdpPort + 1);
|
||||
}
|
||||
// I2P go down not up so we don't run into other I2P things
|
||||
setSSDPPort(ssdpPort - 1);
|
||||
ssdpPort = getSSDPPort();
|
||||
}
|
||||
ssdpSearchResponseSocketList.setControlPoint(this);
|
||||
|
||||
Reference in new issue
Block a user