[upnp] fix code

This commit is contained in:
R4SAS 2019-06-04 22:19:26 +03:00
parent 06066a4df5
commit 2f516d03a5
2 changed files with 56 additions and 54 deletions

View file

@ -79,9 +79,10 @@ namespace transport
void UPnP::Discover ()
{
bool isError;
#if (MINIUPNPC_API_VERSION >= 8)
int err = UPNPDISCOVER_SUCCESS;
bool isError;
#if (MINIUPNPC_API_VERSION >= 14)
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, 2, &err);
@ -92,7 +93,7 @@ namespace transport
isError = err != UPNPDISCOVER_SUCCESS;
#else
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0);
isError = err == NULL;
isError = m_Devlist == NULL;
#endif
{
// notify starting thread

View file

@ -77,6 +77,7 @@ namespace i2p {
/* class stub */
class UPnP {
public:
UPnP () {};
~UPnP () {};
void Start () { LogPrint(eLogWarning, "UPnP: this module was disabled at compile-time"); }