* More MSVC fixes, using XINLINE instead of inline, MSVC has troubles

with inline. Thanks to David Maass for reporting.
* Changed XINLINE to UPNP_INLINE.
* Lots of white space changes.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@192 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez
2007-05-23 13:20:55 +00:00
parent d8ba182d85
commit 81635d74c1
23 changed files with 335 additions and 302 deletions

View File

@@ -55,12 +55,12 @@
/************************************************************************
* Function : send_search_result
*
* Parameters:
* Function : send_search_result
*
* Parameters:
* IN void *data: Search reply from the device
*
* Description:
*
* Description:
* This function sends a callback to the control point application with
* a SEARCH result
*
@@ -125,16 +125,16 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
// we are assuming that there can be only one client supported at a time
HandleLock( );
HandleLock();
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
HandleUnlock( );
HandleUnlock();
return;
}
// copy
ctrlpt_callback = ctrlpt_info->Callback;
ctrlpt_cookie = ctrlpt_info->Cookie;
HandleUnlock( );
HandleUnlock();
// search timeout
if( timeout ) {
@@ -268,9 +268,9 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
return; // bad reply
}
//check each current search
HandleLock( );
HandleLock();
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
HandleUnlock( );
HandleUnlock();
return;
}
node = ListHead( &ctrlpt_info->SsdpSearchList );
@@ -344,28 +344,30 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
node = ListNext( &ctrlpt_info->SsdpSearchList, node );
}
HandleUnlock( );
HandleUnlock();
//ctrlpt_callback( UPNP_DISCOVERY_SEARCH_RESULT, &param, cookie );
}
}
/************************************************************************
* Function : process_reply
*
* Parameters:
* IN char* request_buf: the response came from the device
* IN int buf_len: The length of the response buffer
* IN struct sockaddr_in* dest_addr: The address of the device
* IN void *cookie : cookie passed by the control point application
* at the time of sending search message
* Function : process_reply
*
* Description:
* Parameters:
* IN char* request_buf: the response came from the device
* IN int buf_len: The length of the response buffer
* IN struct sockaddr_in* dest_addr: The address of the device
* IN void *cookie : cookie passed by the control point application
* at the time of sending search message
*
* Description:
* This function processes reply recevied from a search
*
* Returns: void
*
***************************************************************************/
static XINLINE void
#warning There are currently no uses of the function 'process_reply()' in the code.
#warning 'process_reply()' is a good candidate for removal.
static UPNP_INLINE void
process_reply( IN char *request_buf,
IN int buf_len,
IN struct sockaddr_in *dest_addr,
@@ -388,17 +390,17 @@ process_reply( IN char *request_buf,
}
/************************************************************************
* Function : CreateClientRequestPacket
*
* Parameters:
* IN char * RqstBuf:Output string in HTTP format.
* IN char *SearchTarget:Search Target
* IN int Mx dest_addr: Number of seconds to wait to
* collect all the responses
* Function : CreateClientRequestPacket
*
* Description:
* Parameters:
* IN char * RqstBuf:Output string in HTTP format.
* IN char *SearchTarget:Search Target
* IN int Mx dest_addr: Number of seconds to wait to
* collect all the responses
*
* Description:
* This function creates a HTTP search request packet
* depending on the input parameter.
* depending on the input parameter.
*
* Returns: void
*
@@ -430,12 +432,12 @@ CreateClientRequestPacket( IN char *RqstBuf,
}
/************************************************************************
* Function : searchExpired
*
* Parameters:
* Function : searchExpired
*
* Parameters:
* IN void * arg:
*
* Description:
* Description:
* This function
*
* Returns: void
@@ -456,13 +458,13 @@ searchExpired( void *arg )
void *cookie = NULL;
int found = 0;
HandleLock( );
HandleLock();
//remove search target from search list
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
free( id );
HandleUnlock( );
HandleUnlock();
return;
}
@@ -483,7 +485,7 @@ searchExpired( void *arg )
}
node = ListNext( &ctrlpt_info->SsdpSearchList, node );
}
HandleUnlock( );
HandleUnlock();
if( found ) {
ctrlpt_callback( UPNP_DISCOVERY_SEARCH_TIMEOUT, NULL, cookie );
@@ -558,9 +560,9 @@ SearchByTarget( IN int Mx,
FD_SET( gSsdpReqSocket, &wrSet );
//add search criteria to list
HandleLock( );
HandleLock();
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
HandleUnlock( );
HandleUnlock();
free( ReqBuf );
return UPNP_E_INTERNAL_ERROR;
}
@@ -581,7 +583,7 @@ SearchByTarget( IN int Mx,
newArg->timeoutEventId = ( *id );
ListAddTail( &ctrlpt_info->SsdpSearchList, newArg );
HandleUnlock( );
HandleUnlock();
setsockopt( gSsdpReqSocket, IPPROTO_IP, IP_MULTICAST_IF,
( char * )&addr, sizeof( addr ) );