Improoving debug code.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@377 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
efb6812b3e
commit
e90e549cbb
@ -464,9 +464,11 @@ int UpnpRegisterRootDevice(
|
|||||||
|
|
||||||
retVal = UpnpDownloadXmlDoc(HInfo->DescURL, &(HInfo->DescDocument));
|
retVal = UpnpDownloadXmlDoc(HInfo->DescURL, &(HInfo->DescDocument));
|
||||||
if (retVal != UPNP_E_SUCCESS) {
|
if (retVal != UPNP_E_SUCCESS) {
|
||||||
|
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
|
"UpnpRegisterRootDevice: error downloading Document: %d\n",
|
||||||
|
retVal);
|
||||||
CLIENTONLY( ListDestroy(&HInfo->SsdpSearchList, 0); )
|
CLIENTONLY( ListDestroy(&HInfo->SsdpSearchList, 0); )
|
||||||
FreeHandle(*Hnd);
|
FreeHandle(*Hnd);
|
||||||
retVal = retVal;
|
|
||||||
goto exit_function;
|
goto exit_function;
|
||||||
}
|
}
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
@ -3144,9 +3146,7 @@ UpnpDownloadUrlItem( const char *url,
|
|||||||
* Return Values: int
|
* Return Values: int
|
||||||
* UPNP_E_SUCCESS if successful else sends appropriate error.
|
* UPNP_E_SUCCESS if successful else sends appropriate error.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int
|
int UpnpDownloadXmlDoc(const char *url, IXML_Document **xmlDoc)
|
||||||
UpnpDownloadXmlDoc( const char *url,
|
|
||||||
IXML_Document ** xmlDoc )
|
|
||||||
{
|
{
|
||||||
int ret_code;
|
int ret_code;
|
||||||
char *xml_buf;
|
char *xml_buf;
|
||||||
@ -3159,7 +3159,7 @@ UpnpDownloadXmlDoc( const char *url,
|
|||||||
ret_code = UpnpDownloadUrlItem(url, &xml_buf, content_type);
|
ret_code = UpnpDownloadUrlItem(url, &xml_buf, content_type);
|
||||||
if (ret_code != UPNP_E_SUCCESS) {
|
if (ret_code != UPNP_E_SUCCESS) {
|
||||||
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||||
"retCode: %d\n", ret_code );
|
"Error downloading document, retCode: %d\n", ret_code);
|
||||||
return ret_code;
|
return ret_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3178,13 +3178,16 @@ UpnpDownloadXmlDoc( const char *url,
|
|||||||
|
|
||||||
ret_code = ixmlParseBufferEx(xml_buf, xmlDoc);
|
ret_code = ixmlParseBufferEx(xml_buf, xmlDoc);
|
||||||
free(xml_buf);
|
free(xml_buf);
|
||||||
|
|
||||||
if (ret_code != IXML_SUCCESS) {
|
if (ret_code != IXML_SUCCESS) {
|
||||||
UpnpPrintf( UPNP_CRITICAL, API, __FILE__, __LINE__,
|
|
||||||
"Invalid desc\n" );
|
|
||||||
if (ret_code == IXML_INSUFFICIENT_MEMORY) {
|
if (ret_code == IXML_INSUFFICIENT_MEMORY) {
|
||||||
|
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||||
|
"Out of memory, ixml error code: %d\n",
|
||||||
|
ret_code);
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
} else {
|
} else {
|
||||||
|
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||||
|
"Invalid Description, ixml error code: %d\n",
|
||||||
|
ret_code);
|
||||||
return UPNP_E_INVALID_DESC;
|
return UPNP_E_INVALID_DESC;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -3198,6 +3201,7 @@ UpnpDownloadXmlDoc( const char *url,
|
|||||||
#endif
|
#endif
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Exiting UpnpDownloadXmlDoc\n");
|
"Exiting UpnpDownloadXmlDoc\n");
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4121,15 +4125,15 @@ int FreeHandle(int Upnp_Handle)
|
|||||||
int ret = UPNP_E_INVALID_HANDLE;
|
int ret = UPNP_E_INVALID_HANDLE;
|
||||||
|
|
||||||
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__,
|
||||||
"FreeHandleInfo: entering, Handle is %d\n", Upnp_Handle);
|
"FreeHandle: entering, Handle is %d\n", Upnp_Handle);
|
||||||
|
|
||||||
if (Upnp_Handle < 1 || Upnp_Handle >= NUM_HANDLE) {
|
if (Upnp_Handle < 1 || Upnp_Handle >= NUM_HANDLE) {
|
||||||
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||||
"FreeHandleInfo: Handle %d is out of range\n",
|
"FreeHandle: Handle %d is out of range\n",
|
||||||
Upnp_Handle);
|
Upnp_Handle);
|
||||||
} else if (HandleTable[Upnp_Handle] == NULL) {
|
} else if (HandleTable[Upnp_Handle] == NULL) {
|
||||||
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||||
"FreeHandleInfo: HandleTable[%d] is NULL\n",
|
"FreeHandle: HandleTable[%d] is NULL\n",
|
||||||
Upnp_Handle);
|
Upnp_Handle);
|
||||||
} else {
|
} else {
|
||||||
free( HandleTable[Upnp_Handle] );
|
free( HandleTable[Upnp_Handle] );
|
||||||
@ -4137,7 +4141,8 @@ int FreeHandle(int Upnp_Handle)
|
|||||||
ret = UPNP_E_SUCCESS;
|
ret = UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, "FreeHandleInfo: exiting\n");
|
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
|
"FreeHandle: exiting, ret = %d.\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user