For version > 1.6.24 and < 1.8.0
Maybe version numbers to adjust.
This commit is contained in:
Phenom 2019-07-24 16:32:38 +02:00
parent 933a6f1133
commit f9d62c57c9
2 changed files with 27 additions and 8 deletions

View File

@ -347,12 +347,12 @@ const std::string CUPnPLib::Element_GetAttributeByTag(
CUPnPError::CUPnPError( CUPnPError::CUPnPError(
const CUPnPLib &upnpLib, const CUPnPLib &upnpLib,
IXML_Document *errorDoc) const IXML_Document *errorDoc)
: :
m_root (upnpLib.Element_GetRootElement(errorDoc)), m_root (upnpLib.Element_GetRootElement(errorDoc)),
m_ErrorCode (upnpLib.Element_GetChildValueByTag(m_root, "errorCode")), m_ErrorCode (upnpLib.Element_GetChildValueByTag(m_root, "errorCode")),
m_ErrorDescription(upnpLib.Element_GetChildValueByTag(m_root, "errorDescription")) m_ErrorDescription(upnpLib.Element_GetChildValueByTag(m_root, "errorDescription"))
{ {
} }
@ -488,7 +488,8 @@ m_timeout(1801),
m_SCPD(NULL) m_SCPD(NULL)
{ {
int errcode; int errcode;
m_SID[0]=0;
std::vector<char> vscpdURL(URLBase.length() + m_SCPDURL.length() + 1); std::vector<char> vscpdURL(URLBase.length() + m_SCPDURL.length() + 1);
char *scpdURL = &vscpdURL[0]; char *scpdURL = &vscpdURL[0];
errcode = UpnpResolveURL( errcode = UpnpResolveURL(
@ -1333,6 +1334,12 @@ int CUPnPControlPoint::Callback(
std::string devType(upnpCP->m_upnpLib. std::string devType(upnpCP->m_upnpLib.
Element_GetChildValueByTag(rootDevice, "deviceType")); 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 // Only add device if it is an InternetGatewayDevice
if (stdStringIsEqualCI(devType, upnpCP->m_upnpLib.UPNP_DEVICE_IGW)) if (stdStringIsEqualCI(devType, upnpCP->m_upnpLib.UPNP_DEVICE_IGW))
{ {
@ -1351,6 +1358,10 @@ int CUPnPControlPoint::Callback(
rootDevice, urlBase, rootDevice, urlBase,
UpnpDiscovery_get_Location_cstr(d_event), UpnpDiscovery_get_Location_cstr(d_event),
UpnpDiscovery_get_Expires(d_event) ); UpnpDiscovery_get_Expires(d_event) );
#if (UPNP_VERSION > 10624) && (UPNP_VERSION < 10800)
upnpCP->m_WaitForSearchTimeoutMutex.unlock();
#endif
} }
// Free the XML doc tree // Free the XML doc tree
@ -1359,6 +1370,13 @@ int CUPnPControlPoint::Callback(
} }
case UPNP_DISCOVERY_SEARCH_TIMEOUT: 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 // Unlock the search timeout mutex
upnpCP->m_WaitForSearchTimeoutMutex.unlock(); upnpCP->m_WaitForSearchTimeoutMutex.unlock();
break; break;

View File

@ -43,6 +43,7 @@
extern std::string stdEmptyString; extern std::string stdEmptyString;
#endif // UPNP_C #endif // UPNP_C
//#define UPNP_DEBUG 1
/** /**
* Case insensitive std::string comparison * Case insensitive std::string comparison
@ -255,7 +256,7 @@ private:
public: public:
CUPnPError( CUPnPError(
const CUPnPLib &upnpLib, const CUPnPLib &upnpLib,
IXML_Document *errorDoc); const IXML_Document *errorDoc);
~CUPnPError() {} ~CUPnPError() {}
const std::string &getErrorCode() const const std::string &getErrorCode() const
{ return m_ErrorCode; } { return m_ErrorCode; }