mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix UPnP
For version > 1.6.24 and < 1.8.0 Maybe version numbers to adjust.
This commit is contained in:
parent
933a6f1133
commit
f9d62c57c9
@ -347,12 +347,12 @@ const std::string CUPnPLib::Element_GetAttributeByTag(
|
||||
|
||||
|
||||
CUPnPError::CUPnPError(
|
||||
const CUPnPLib &upnpLib,
|
||||
IXML_Document *errorDoc)
|
||||
:
|
||||
m_root (upnpLib.Element_GetRootElement(errorDoc)),
|
||||
m_ErrorCode (upnpLib.Element_GetChildValueByTag(m_root, "errorCode")),
|
||||
m_ErrorDescription(upnpLib.Element_GetChildValueByTag(m_root, "errorDescription"))
|
||||
const CUPnPLib &upnpLib,
|
||||
const IXML_Document *errorDoc)
|
||||
:
|
||||
m_root (upnpLib.Element_GetRootElement(errorDoc)),
|
||||
m_ErrorCode (upnpLib.Element_GetChildValueByTag(m_root, "errorCode")),
|
||||
m_ErrorDescription(upnpLib.Element_GetChildValueByTag(m_root, "errorDescription"))
|
||||
{
|
||||
}
|
||||
|
||||
@ -488,7 +488,8 @@ m_timeout(1801),
|
||||
m_SCPD(NULL)
|
||||
{
|
||||
int errcode;
|
||||
|
||||
m_SID[0]=0;
|
||||
|
||||
std::vector<char> vscpdURL(URLBase.length() + m_SCPDURL.length() + 1);
|
||||
char *scpdURL = &vscpdURL[0];
|
||||
errcode = UpnpResolveURL(
|
||||
@ -1333,6 +1334,12 @@ int CUPnPControlPoint::Callback(
|
||||
std::string devType(upnpCP->m_upnpLib.
|
||||
Element_GetChildValueByTag(rootDevice, "deviceType"));
|
||||
|
||||
#ifdef UPNP_DEBUG
|
||||
std::cerr << "CUPnPControlPoint::Callback() EventType==UPNP_DISCOVERY_SEARCH_RESULT" << std::endl
|
||||
<< "urlBase:" << urlBase << std::endl
|
||||
<< "devType:" << devType << std::endl;
|
||||
#endif
|
||||
|
||||
// Only add device if it is an InternetGatewayDevice
|
||||
if (stdStringIsEqualCI(devType, upnpCP->m_upnpLib.UPNP_DEVICE_IGW))
|
||||
{
|
||||
@ -1351,6 +1358,10 @@ int CUPnPControlPoint::Callback(
|
||||
rootDevice, urlBase,
|
||||
UpnpDiscovery_get_Location_cstr(d_event),
|
||||
UpnpDiscovery_get_Expires(d_event) );
|
||||
|
||||
#if (UPNP_VERSION > 10624) && (UPNP_VERSION < 10800)
|
||||
upnpCP->m_WaitForSearchTimeoutMutex.unlock();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Free the XML doc tree
|
||||
@ -1359,6 +1370,13 @@ int CUPnPControlPoint::Callback(
|
||||
}
|
||||
case UPNP_DISCOVERY_SEARCH_TIMEOUT:
|
||||
{
|
||||
#if (UPNP_VERSION > 10624) && (UPNP_VERSION < 10800)
|
||||
std::cerr << "********************************************************************************" << std::endl
|
||||
<< "*** THIS SHOULD NOT HAPPEN !!! TELL IT TO DEVS ***" << std::endl
|
||||
<< "*** UPnPBase.cpp CUPnPControlPoint::Callback() UPNP_DISCOVERY_SEARCH_TIMEOUT ***" << std::endl
|
||||
<< "********************************************************************************" << std::endl;
|
||||
#endif
|
||||
|
||||
// Unlock the search timeout mutex
|
||||
upnpCP->m_WaitForSearchTimeoutMutex.unlock();
|
||||
break;
|
||||
|
@ -43,6 +43,7 @@
|
||||
extern std::string stdEmptyString;
|
||||
#endif // UPNP_C
|
||||
|
||||
//#define UPNP_DEBUG 1
|
||||
|
||||
/**
|
||||
* Case insensitive std::string comparison
|
||||
@ -255,7 +256,7 @@ private:
|
||||
public:
|
||||
CUPnPError(
|
||||
const CUPnPLib &upnpLib,
|
||||
IXML_Document *errorDoc);
|
||||
const IXML_Document *errorDoc);
|
||||
~CUPnPError() {}
|
||||
const std::string &getErrorCode() const
|
||||
{ return m_ErrorCode; }
|
||||
|
Loading…
Reference in New Issue
Block a user