summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2021-05-14 16:42:08 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2021-06-07 00:36:35 +0200
commitc3560f033ee69eb4ff0edc916d329e5490058654 (patch)
tree552f0376fdce057d3e7f10646f58d5538a1369fb /Source/Core
parentfd4efd3787bd5978e59317a56905e6e78ae5a951 (diff)
UPnP: Improve error messages on initialization failure.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/UPnP.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/Source/Core/Common/UPnP.cpp b/Source/Core/Common/UPnP.cpp
index ea6a18d046..2f13be10c8 100644
--- a/Source/Core/Common/UPnP.cpp
+++ b/Source/Core/Common/UPnP.cpp
@@ -16,6 +16,7 @@
#include <string>
#include <thread>
#include <upnpcommands.h>
+#include <upnperrors.h>
#include <vector>
static UPNPUrls s_urls;
@@ -52,7 +53,15 @@ static bool InitUPnP()
#endif
if (!devlist)
{
- WARN_LOG_FMT(NETPLAY, "An error occurred trying to discover UPnP devices.");
+ if (upnperror == UPNPDISCOVER_SUCCESS)
+ {
+ WARN_LOG_FMT(NETPLAY, "No UPnP devices could be found.");
+ }
+ else
+ {
+ WARN_LOG_FMT(NETPLAY, "An error occurred trying to discover UPnP devices: {}",
+ strupnperror(upnperror));
+ }
s_error = true;
@@ -60,6 +69,7 @@ static bool InitUPnP()
}
// Look for the IGD
+ bool found_valid_igd = false;
for (UPNPDev* dev = devlist.get(); dev; dev = dev->pNext)
{
if (!std::strstr(dev->st, "InternetGatewayDevice"))
@@ -81,6 +91,7 @@ static bool InitUPnP()
parserootdesc(desc_xml.get(), desc_xml_size, &s_data);
GetUPNPUrls(&s_urls, &s_data, dev->descURL, 0);
+ found_valid_igd = true;
NOTICE_LOG_FMT(NETPLAY, "Got info from IGD at {}.", dev->descURL);
break;
}
@@ -90,6 +101,9 @@ static bool InitUPnP()
}
}
+ if (!found_valid_igd)
+ WARN_LOG_FMT(NETPLAY, "Could not find a valid IGD in the discovered UPnP devices.");
+
s_inited = true;
return true;