Attempt to detect best UPnP library available

Because we don't support libupnp-1.8.x yet avoid using that library
If libupnp-1.6.x is available use that, if not try to use miniupnc if
  if unavailble print a warning and disable RetroShare UPnP support
This commit is contained in:
Gioacchino Mazzurco 2019-04-24 18:08:35 +02:00
parent 2498f945f4
commit fb4f206427
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
3 changed files with 56 additions and 9 deletions

View file

@ -653,10 +653,14 @@ SOURCES += util/folderiterator.cc \
equals(RS_UPNP_LIB, miniupnpc) {
HEADERS += upnp/upnputil.h upnp/upnphandler_miniupnp.h
SOURCES += upnp/upnputil.c upnp/upnphandler_miniupnp.cc
} else {
HEADERS += upnp/UPnPBase.h upnp/upnphandler_linux.h
SOURCES += upnp/UPnPBase.cpp upnp/upnphandler_linux.cc
DEFINES *= RS_USE_LIBUPNP
}
equals(RS_UPNP_LIB, "upnp ixml") { ## libupnp-1.8.x
# Not supported yet
}
equals(RS_UPNP_LIB, "upnp ixml threadutil") { ## libupnp-1.6.x
HEADERS += upnp/UPnPBase.h upnp/upnphandler_linux.h
SOURCES += upnp/UPnPBase.cpp upnp/upnphandler_linux.cc
DEFINES *= RS_USE_LIBUPNP
}
# new gxs cache system

View file

@ -1586,9 +1586,11 @@ int RsServer::StartupRetroShare()
mNetMgr->addNetListener(mProxyStack);
#endif
#if defined(RS_USE_LIBMINIUPNPC) || defined(RS_USE_LIBUPNP)
// Original UPnP Interface.
pqiNetAssistFirewall *mUpnpMgr = new upnphandler();
mNetMgr->addNetAssistFirewall(1, mUpnpMgr);
#endif // defined(RS_USE_LIBMINIUPNPC) || defined(RS_USE_LIBUPNP)
}
/**************************************************************************/