Fix problems detected as dead assignment warning by clang scan-build.
Wrong assignment by shutdown result hides the real error code
of NewRequestHandler() in ssdp_device.c.
Fix return code description of NewRequestHandler().
Handle return code from ithread_create in sample applications.
Remove unused assignments.
(forward ported from commit 39dfad2cba
)
This commit is contained in:
parent
76e8812acc
commit
c27a089d6f
10
ChangeLog
10
ChangeLog
@ -332,6 +332,16 @@ Version 1.8.0
|
||||
Version 1.6.18
|
||||
*******************************************************************************
|
||||
|
||||
2012-04-21 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||
|
||||
Fix problems detected as dead assignment warning by clang scan-build.
|
||||
|
||||
Wrong assignment by shutdown result hides the real error code
|
||||
of NewRequestHandler() in ssdp_device.c.
|
||||
Fix return code description of NewRequestHandler().
|
||||
Handle return code from ithread_create in sample applications.
|
||||
Remove unused assignments.
|
||||
|
||||
2012-04-20 Yoichi NAKAYAMA <yoichi.nakayama(at)gmail.com>
|
||||
|
||||
Avoid dereference of null pointer in ixmlNode_setNodeProperties.
|
||||
|
@ -55,6 +55,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
/* start a command loop thread */
|
||||
code = ithread_create(&cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL);
|
||||
if (code != 0) {
|
||||
return UPNP_E_INTERNAL_ERROR;
|
||||
}
|
||||
#ifdef WIN32
|
||||
ithread_join(cmdloop_thread, NULL);
|
||||
#else
|
||||
|
@ -54,6 +54,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
/* start a command loop thread */
|
||||
code = ithread_create(&cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL);
|
||||
if (code != 0) {
|
||||
return UPNP_E_INTERNAL_ERROR;
|
||||
}
|
||||
#ifdef WIN32
|
||||
ithread_join(cmdloop_thread, NULL);
|
||||
#else
|
||||
|
@ -53,6 +53,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* start a command loop thread */
|
||||
code = ithread_create(&cmdloop_thread, NULL, TvDeviceCommandLoop, NULL);
|
||||
if (code != 0) {
|
||||
return UPNP_E_INTERNAL_ERROR;
|
||||
}
|
||||
#ifdef WIN32
|
||||
ithread_join(cmdloop_thread, NULL);
|
||||
#else
|
||||
|
@ -102,12 +102,11 @@ static int GeneratePropertySet(
|
||||
char *buffer;
|
||||
int counter = 0;
|
||||
size_t size = 0;
|
||||
int temp_counter = 0;
|
||||
|
||||
/*size += strlen(XML_VERSION);*/
|
||||
size += strlen(XML_PROPERTYSET_HEADER);
|
||||
size += strlen("</e:propertyset>\n\n");
|
||||
for (temp_counter = 0, counter = 0; counter < count; counter++) {
|
||||
for (counter = 0; counter < count; counter++) {
|
||||
size += strlen( "<e:property>\n</e:property>\n" );
|
||||
size += 2 * strlen(names[counter]) +
|
||||
strlen(values[counter]) +
|
||||
|
@ -1000,7 +1000,6 @@ static int ReadResponseLineAndHeaders(
|
||||
return num_read;
|
||||
}
|
||||
}
|
||||
done = 0;
|
||||
status = parser_parse_headers(parser);
|
||||
if ((status == (parse_status_t)PARSE_OK) &&
|
||||
(parser->position == (parser_pos_t)POS_ENTITY))
|
||||
|
@ -926,7 +926,6 @@ removeServiceTable( IXML_Node * node,
|
||||
long unsigned int i = 0lu;
|
||||
|
||||
if( getSubElement( "root", node, &root ) ) {
|
||||
current_service = in->serviceList;
|
||||
start_search = in->serviceList;
|
||||
deviceList =
|
||||
ixmlElement_getElementsByTagName( ( IXML_Element * ) root,
|
||||
|
@ -242,7 +242,6 @@ void ssdp_handle_ctrlpt_msg(http_message_t *hmsg, struct sockaddr_storage *dest_
|
||||
/*hdr_value.buf[ hdr_value.length ] = '\0'; */
|
||||
while (node != NULL) {
|
||||
searchArg = node->item;
|
||||
matched = 0;
|
||||
/* check for match of ST header and search target */
|
||||
switch (searchArg->requestType) {
|
||||
case SSDP_ALL:
|
||||
|
@ -169,7 +169,7 @@ void ssdp_handle_device_request(http_message_t *hmsg, struct sockaddr_storage *d
|
||||
* \brief Works as a request handler which passes the HTTP request string
|
||||
* to multicast channel.
|
||||
*
|
||||
* \return 1 if successful else appropriate error.
|
||||
* \return UPNP_E_SUCCESS if successful else appropriate error.
|
||||
*/
|
||||
static int NewRequestHandler(
|
||||
/*! [in] Ip address, to send the reply. */
|
||||
@ -246,8 +246,7 @@ static int NewRequestHandler(
|
||||
}
|
||||
|
||||
end_NewRequestHandler:
|
||||
ret = shutdown(ReplySock, SD_BOTH);
|
||||
if (ret == -1) {
|
||||
if (shutdown(ReplySock, SD_BOTH) == -1) {
|
||||
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
|
||||
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__,
|
||||
"Error in shutdown: %s\n", errorBuffer);
|
||||
|
@ -864,8 +864,8 @@ static int create_ssdp_sock_v4(
|
||||
/* This is probably not a critical error, so let's continue. */
|
||||
}
|
||||
/* result is not checked becuase it will fail in WinMe and Win9x. */
|
||||
ret = setsockopt(*ssdpSock, IPPROTO_IP,
|
||||
IP_MULTICAST_TTL, &ttl, sizeof(ttl));
|
||||
setsockopt(*ssdpSock, IPPROTO_IP,
|
||||
IP_MULTICAST_TTL, &ttl, sizeof(ttl));
|
||||
onOff = 1;
|
||||
ret = setsockopt(*ssdpSock, SOL_SOCKET, SO_BROADCAST,
|
||||
(char *)&onOff, sizeof(onOff));
|
||||
|
Loading…
Reference in New Issue
Block a user