mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Merge pull request #3708 from ismail/miniupnpc-api-16
Fix build with MINIUPNPC_API_VERSION >= 16
This commit is contained in:
commit
370e91d4c0
@ -942,8 +942,14 @@ bool NetPlayServer::initUPnP()
|
|||||||
|
|
||||||
for (const UPNPDev* dev : igds)
|
for (const UPNPDev* dev : igds)
|
||||||
{
|
{
|
||||||
char* descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0);
|
char* descXML;
|
||||||
if (descXML)
|
int statusCode = 200;
|
||||||
|
#if MINIUPNPC_API_VERSION >= 16
|
||||||
|
descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0, &statusCode);
|
||||||
|
#else
|
||||||
|
descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0);
|
||||||
|
#endif
|
||||||
|
if (descXML && (statusCode == 200))
|
||||||
{
|
{
|
||||||
parserootdesc(descXML, descXMLsize, &m_upnp_data);
|
parserootdesc(descXML, descXMLsize, &m_upnp_data);
|
||||||
free(descXML);
|
free(descXML);
|
||||||
@ -955,6 +961,11 @@ bool NetPlayServer::initUPnP()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (descXML)
|
||||||
|
{
|
||||||
|
free(descXML);
|
||||||
|
descXML = nullptr;
|
||||||
|
}
|
||||||
WARN_LOG(NETPLAY, "Error getting info from IGD at %s.", dev->descURL);
|
WARN_LOG(NETPLAY, "Error getting info from IGD at %s.", dev->descURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user