mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-14 04:51:53 +02:00
Fix for bug TWK-221, Segfault at start due to UPnP device description XML download fail.
Further work FIXME: Figure out how to make it use the proper port (81 eg. instaed of standard 80) maybe it's upnpDiscover() that's not working correcly
This commit is contained in:
parent
c9c1cc5b17
commit
093e960af2
17
thirdparty/libportfwd/src/portfwd.cpp
vendored
17
thirdparty/libportfwd/src/portfwd.cpp
vendored
@ -82,10 +82,22 @@ Portfwd::init(unsigned int timeout)
|
||||
free (descXML); descXML = 0;
|
||||
GetUPNPUrls (urls, data, dev->descURL);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("couldn't get the UPnP device description XML (descXML is null)");
|
||||
freeUPNPDevlist(devlist);
|
||||
return false;
|
||||
}
|
||||
// get lan IP:
|
||||
char lanaddr[16];
|
||||
int i;
|
||||
i = UPNP_GetValidIGD(devlist, urls, data, (char*)&lanaddr, 16);
|
||||
int idg_was_found = UPNP_GetValidIGD(devlist, urls, data, (char*)&lanaddr, 16);
|
||||
printf("UPNP_GetValidIGD returned %d", idg_was_found);
|
||||
if (!idg_was_found)
|
||||
{
|
||||
printf("NO IGD was found (function UPNP_GetValidIGD())");
|
||||
freeUPNPDevlist(devlist);
|
||||
return false;
|
||||
}
|
||||
m_lanip = std::string(lanaddr);
|
||||
|
||||
freeUPNPDevlist(devlist);
|
||||
@ -98,6 +110,7 @@ Portfwd::init(unsigned int timeout)
|
||||
void
|
||||
Portfwd::get_status()
|
||||
{
|
||||
Q_ASSERT(urls->controlURL_CIF != NULL);
|
||||
// get connection speed
|
||||
UPNP_GetLinkLayerMaxBitRates(
|
||||
urls->controlURL_CIF, data->CIF.servicetype, &m_downbps, &m_upbps);
|
||||
|
Loading…
x
Reference in New Issue
Block a user