explicit merge of '59eae97dbb470d8c4a1e4dba3a9763e134bb0c53'

and 'aeec86a504a5fd67dff12d6775411a9c865d42ad'


Merge to aeec86a504a5fd67dff12d6775411a9c865d42ad
which is just before the 2009-08-11 whitespace cleanup at ef1c23821d433903124f7612cbc46ac096fc985b
This commit is contained in:
zzz
2012-05-25 19:36:22 +00:00
994 changed files with 128750 additions and 9391 deletions

View File

@@ -293,18 +293,25 @@ public class ControlPoint implements HTTPRequestListener
for (int n=0; n<nRoots; n++) {
Node rootNode = devNodeList.getNode(n);
Device dev = getDevice(rootNode);
if (dev == null)
continue;
devList.add(dev);
}
return devList;
}
public Device getDevice(String name)
{
int nRoots = devNodeList.size();
for (int n=0; n<nRoots; n++) {
Node rootNode = devNodeList.getNode(n);
if (dev == null)
continue;
devList.add(dev);
}
return devList;
}
public Device getDevice(String name)
{
int nRoots = devNodeList.size();
for (int n=0; n<nRoots; n++) {
// AIOOB was thrown from here, maybe would be better to
// copy the list before traversal?
Node rootNode;
try {
rootNode = devNodeList.getNode(n);
} catch (ArrayIndexOutOfBoundsException aioob) {
break;
}
Device dev = getDevice(rootNode);
if (dev == null)
continue;
@@ -825,9 +832,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);
@@ -838,8 +849,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();
@@ -852,9 +865,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);