* Added support for the Basic Device
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by Titus Winters. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@202 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
13ebb40e08
commit
d9de9a486c
@ -2,6 +2,11 @@
|
||||
Version 1.4.7
|
||||
*******************************************************************************
|
||||
|
||||
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Added support for the Basic Device
|
||||
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by
|
||||
Titus Winters.
|
||||
|
||||
2007-05-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Fixed the file libupnp.pc.in to generate a correct path for the
|
||||
include files.
|
||||
|
1
THANKS
1
THANKS
@ -30,4 +30,5 @@ exempt of errors.
|
||||
- Paul Vixie
|
||||
- Siva Chandran
|
||||
- Timothy Redaelli
|
||||
- Titus Winters
|
||||
|
||||
|
@ -592,8 +592,8 @@ UpnpRegisterRootDevice( IN const char *DescUrl,
|
||||
|
||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||
"Inside UpnpRegisterRootDevice\n" );
|
||||
HandleLock();
|
||||
|
||||
HandleLock();
|
||||
if( UpnpSdkDeviceRegistered ) {
|
||||
HandleUnlock();
|
||||
return UPNP_E_ALREADY_REGISTERED;
|
||||
@ -651,7 +651,7 @@ UpnpRegisterRootDevice( IN const char *DescUrl,
|
||||
|
||||
HInfo->DeviceList =
|
||||
ixmlDocument_getElementsByTagName( HInfo->DescDocument, "device" );
|
||||
if( HInfo->DeviceList == NULL ) {
|
||||
if( !HInfo->DeviceList ) {
|
||||
CLIENTONLY( ListDestroy( &HInfo->SsdpSearchList, 0 ) );
|
||||
ixmlDocument_free( HInfo->DescDocument );
|
||||
FreeHandle( *Hnd );
|
||||
@ -661,18 +661,11 @@ UpnpRegisterRootDevice( IN const char *DescUrl,
|
||||
return UPNP_E_INVALID_DESC;
|
||||
}
|
||||
|
||||
HInfo->ServiceList =
|
||||
ixmlDocument_getElementsByTagName( HInfo->DescDocument,
|
||||
"serviceList" );
|
||||
if( HInfo->ServiceList == NULL ) {
|
||||
CLIENTONLY( ListDestroy( &HInfo->SsdpSearchList, 0 ) );
|
||||
ixmlNodeList_free( HInfo->DeviceList );
|
||||
ixmlDocument_free( HInfo->DescDocument );
|
||||
FreeHandle( *Hnd );
|
||||
HandleUnlock();
|
||||
HInfo->ServiceList = ixmlDocument_getElementsByTagName(
|
||||
HInfo->DescDocument, "serviceList" );
|
||||
if( !HInfo->ServiceList ) {
|
||||
UpnpPrintf( UPNP_CRITICAL, API, __FILE__, __LINE__,
|
||||
"UpnpRegisterRootDevice: No services found for RootDevice\n" );
|
||||
return UPNP_E_INVALID_DESC;
|
||||
}
|
||||
|
||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||
@ -688,23 +681,17 @@ UpnpRegisterRootDevice( IN const char *DescUrl,
|
||||
"Here are the known services: \n" );
|
||||
printServiceTable( &HInfo->ServiceTable, UPNP_INFO, API );
|
||||
} else {
|
||||
CLIENTONLY( ListDestroy( &HInfo->SsdpSearchList, 0 ); )
|
||||
FreeHandle( *Hnd );
|
||||
HandleUnlock();
|
||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||
"\nUpnpRegisterRootDevice: Errors retrieving service table \n" );
|
||||
return UPNP_E_INVALID_DESC;
|
||||
"\nUpnpRegisterRootDevice2: Empty service table\n" );
|
||||
}
|
||||
|
||||
UpnpSdkDeviceRegistered = 1;
|
||||
HandleUnlock();
|
||||
|
||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||
"Exiting RegisterRootDevice Successfully\n" );
|
||||
|
||||
return UPNP_E_SUCCESS;
|
||||
|
||||
} /****************** End of UpnpRegisterRootDevice *********************/
|
||||
}
|
||||
|
||||
#endif // INCLUDE_DEVICE_APIS
|
||||
|
||||
@ -1158,7 +1145,6 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
struct Handle_Info *HInfo;
|
||||
int retVal = 0;
|
||||
char *description = ( char * )description_const;
|
||||
|
||||
if( UpnpSdkInit != 1 ) {
|
||||
return UPNP_E_FINISH;
|
||||
}
|
||||
@ -1171,7 +1157,6 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
}
|
||||
|
||||
HandleLock();
|
||||
|
||||
if( UpnpSdkDeviceRegistered ) {
|
||||
HandleUnlock();
|
||||
return UPNP_E_ALREADY_REGISTERED;
|
||||
@ -1192,9 +1177,9 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
// prevent accidental removal of a non-existent alias
|
||||
HInfo->aliasInstalled = 0;
|
||||
|
||||
retVal = GetDescDocumentAndURL( descriptionType, description,
|
||||
bufferLen, config_baseURL,
|
||||
&HInfo->DescDocument, HInfo->DescURL );
|
||||
retVal = GetDescDocumentAndURL(
|
||||
descriptionType, description, bufferLen,
|
||||
config_baseURL, &HInfo->DescDocument, HInfo->DescURL );
|
||||
|
||||
if( retVal != UPNP_E_SUCCESS ) {
|
||||
FreeHandle( *Hnd );
|
||||
@ -1203,15 +1188,16 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
}
|
||||
|
||||
HInfo->aliasInstalled = ( config_baseURL != 0 );
|
||||
|
||||
HInfo->HType = HND_DEVICE;
|
||||
|
||||
HInfo->Callback = Fun;
|
||||
HInfo->Cookie = ( void * )Cookie;
|
||||
HInfo->MaxAge = DEFAULT_MAXAGE;
|
||||
HInfo->DeviceList = NULL;
|
||||
HInfo->ServiceList = NULL;
|
||||
CLIENTONLY( HInfo->ClientSubList = NULL; )
|
||||
|
||||
CLIENTONLY( ListInit( &HInfo->SsdpSearchList, NULL, NULL ); )
|
||||
CLIENTONLY( HInfo->ClientSubList = NULL; )
|
||||
HInfo->MaxSubscriptions = UPNP_INFINITE;
|
||||
HInfo->MaxSubscriptionTimeOut = UPNP_INFINITE;
|
||||
|
||||
@ -1224,7 +1210,7 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
HInfo->DeviceList =
|
||||
ixmlDocument_getElementsByTagName( HInfo->DescDocument, "device" );
|
||||
|
||||
if( HInfo->DeviceList == NULL ) {
|
||||
if( !HInfo->DeviceList ) {
|
||||
CLIENTONLY( ListDestroy( &HInfo->SsdpSearchList, 0 ); )
|
||||
ixmlDocument_free( HInfo->DescDocument );
|
||||
FreeHandle( *Hnd );
|
||||
@ -1234,19 +1220,11 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
return UPNP_E_INVALID_DESC;
|
||||
}
|
||||
|
||||
HInfo->ServiceList =
|
||||
ixmlDocument_getElementsByTagName( HInfo->DescDocument,
|
||||
"serviceList" );
|
||||
|
||||
if( HInfo->ServiceList == NULL ) {
|
||||
CLIENTONLY( ListDestroy( &HInfo->SsdpSearchList, 0 ); )
|
||||
ixmlNodeList_free( HInfo->DeviceList );
|
||||
ixmlDocument_free( HInfo->DescDocument );
|
||||
FreeHandle( *Hnd );
|
||||
HandleUnlock();
|
||||
HInfo->ServiceList = ixmlDocument_getElementsByTagName(
|
||||
HInfo->DescDocument, "serviceList" );
|
||||
if( !HInfo->ServiceList ) {
|
||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||
"UpnpRegisterRootDevice2: No services found for RootDevice\n" );
|
||||
return UPNP_E_INVALID_DESC;
|
||||
}
|
||||
|
||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||
@ -1258,21 +1236,21 @@ UpnpRegisterRootDevice2( IN Upnp_DescType descriptionType,
|
||||
&HInfo->ServiceTable, HInfo->DescURL ) ) {
|
||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||
"UpnpRegisterRootDevice2: GENA Service Table\n" );
|
||||
} else {
|
||||
CLIENTONLY( ListDestroy( &HInfo->SsdpSearchList, 0 ); )
|
||||
FreeHandle( *Hnd );
|
||||
HandleUnlock();
|
||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||
"\nUpnpRegisterRootDevice: Errors retrieving service table \n" );
|
||||
return UPNP_E_INVALID_DESC;
|
||||
"Here are the known services: \n" );
|
||||
printServiceTable( &HInfo->ServiceTable, UPNP_INFO, API );
|
||||
} else {
|
||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||
"\nUpnpRegisterRootDevice2: Empty service table\n" );
|
||||
}
|
||||
|
||||
UpnpSdkDeviceRegistered = 1;
|
||||
HandleUnlock();
|
||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||
"Exiting RegisterRootDevice2 Successfully\n" );
|
||||
return UPNP_E_SUCCESS;
|
||||
|
||||
} /****************** End of UpnpRegisterRootDevice2 *********************/
|
||||
return UPNP_E_SUCCESS;
|
||||
}
|
||||
|
||||
#endif // INCLUDE_DEVICE_APIS
|
||||
|
||||
|
@ -1153,9 +1153,8 @@ getServiceTable( IXML_Node * node,
|
||||
}
|
||||
}
|
||||
|
||||
if( ( out->serviceList = getAllServiceList( root, out->URLBase,
|
||||
&out->
|
||||
endServiceList ) ) ) {
|
||||
if( ( out->serviceList = getAllServiceList(
|
||||
root, out->URLBase, &out->endServiceList ) ) ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,7 @@ typedef struct SERVICE_INFO {
|
||||
struct SERVICE_INFO *next;
|
||||
} service_info;
|
||||
|
||||
|
||||
typedef struct SERVICE_TABLE {
|
||||
DOMString URLBase;
|
||||
service_info *serviceList;
|
||||
|
Loading…
x
Reference in New Issue
Block a user