mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-20 19:44:57 +00:00
Merge pull request #3708 from ismail/miniupnpc-api-16
Fix build with MINIUPNPC_API_VERSION >= 16
This commit is contained in:
commit
370e91d4c0
1 changed files with 13 additions and 2 deletions
|
@ -942,8 +942,14 @@ bool NetPlayServer::initUPnP()
|
|||
|
||||
for (const UPNPDev* dev : igds)
|
||||
{
|
||||
char* descXML = (char*)miniwget(dev->descURL, &descXMLsize, 0);
|
||||
if (descXML)
|
||||
char* 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);
|
||||
free(descXML);
|
||||
|
@ -955,6 +961,11 @@ bool NetPlayServer::initUPnP()
|
|||
}
|
||||
else
|
||||
{
|
||||
if (descXML)
|
||||
{
|
||||
free(descXML);
|
||||
descXML = nullptr;
|
||||
}
|
||||
WARN_LOG(NETPLAY, "Error getting info from IGD at %s.", dev->descURL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue