diff --git a/ChangeLog b/ChangeLog index ad1c244..34c5c6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -332,6 +332,51 @@ Version 1.8.0 Version 1.6.18 ******************************************************************************* +2012-05-25 Anoop Mohan + + This patch fixes a bug in non blocking connect call where the sock + option length for SO_ERROR was passed as 0 instead of sizeof(int). + +2012-04-24 Yoichi NAKAYAMA + + Disable SetGenaCallback call if device is disabled. + + If device is disabled, SetGenaCallback definition is disabled, + but its call remains. A link error will occur in Win32. + +2012-04-21 Yoichi NAKAYAMA + + Fix condition for allocation failure in get_content_type(). + + At the end of get_content_type() in webserver.c, it should check + return value of ixmlCloneDOMString(). + +2012-04-21 Yoichi NAKAYAMA + + 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 + + Avoid dereference of null pointer in ixmlNode_setNodeProperties. + + The problem can occur if one of the arguments is NULL. + Test argument and fix assertion. + +2012-04-17 Yoichi NAKAYAMA + + Create intermediate directory per project on vc9. + + Sample applications share sample_util.c and collisions of + object file can occur in parallel build. Modify project files to + split intermediate directories against it. + Apply similar changes also to library projects, like vc10 projects. + 2012-04-11 Yoichi NAKAYAMA Avoid access violation after parser_parse_chunky_headers call. diff --git a/THANKS b/THANKS index 4bacd2b..e2a6f8f 100644 --- a/THANKS +++ b/THANKS @@ -8,6 +8,7 @@ exempt of errors. - Alex (afaucher) - Andre Sodermans (wienerschnitzel) +- Anoop Mohan (an00p) - Anthony Viallard (homer242) - Apostolos Syropoulos - Arno Willig diff --git a/build/vc9/ixml.vcproj b/build/vc9/ixml.vcproj index ce565cb..760e76d 100644 --- a/build/vc9/ixml.vcproj +++ b/build/vc9/ixml.vcproj @@ -21,7 +21,7 @@ @@ -86,7 +86,7 @@ @@ -152,7 +152,7 @@ @@ -354,7 +354,7 @@ @@ -420,7 +420,7 @@ @@ -98,7 +98,7 @@ @@ -176,7 +176,7 @@ @@ -416,7 +416,7 @@ @@ -494,7 +494,7 @@ @@ -98,7 +98,7 @@ @@ -176,7 +176,7 @@ @@ -416,7 +416,7 @@ @@ -494,7 +494,7 @@ @@ -98,7 +98,7 @@ @@ -176,7 +176,7 @@ @@ -416,7 +416,7 @@ @@ -494,7 +494,7 @@ nodeValue); if(rc != IXML_SUCCESS) { diff --git a/upnp/sample/linux/tv_combo_main.c b/upnp/sample/linux/tv_combo_main.c index 92788e4..cb9909e 100644 --- a/upnp/sample/linux/tv_combo_main.c +++ b/upnp/sample/linux/tv_combo_main.c @@ -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 diff --git a/upnp/sample/linux/tv_ctrlpt_main.c b/upnp/sample/linux/tv_ctrlpt_main.c index 2d40b81..79641fc 100644 --- a/upnp/sample/linux/tv_ctrlpt_main.c +++ b/upnp/sample/linux/tv_ctrlpt_main.c @@ -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 diff --git a/upnp/sample/linux/tv_device_main.c b/upnp/sample/linux/tv_device_main.c index 57e7035..9d59d5e 100644 --- a/upnp/sample/linux/tv_device_main.c +++ b/upnp/sample/linux/tv_device_main.c @@ -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 diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index fb3b8eb..2a24b52 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -374,9 +374,11 @@ static int UpnpInitPreamble(void) #endif #endif /* INCLUDE_DEVICE_APIS */ +#ifdef INTERNAL_WEB_SERVER #if EXCLUDE_GENA == 0 SetGenaCallback(genaCallback); #endif +#endif /* INTERNAL_WEB_SERVER */ /* Initialize the SDK timer thread. */ retVal = TimerThreadInit( &gTimerThread, &gSendThreadPool ); diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c index cd99334..e3b6d2a 100644 --- a/upnp/src/gena/gena_device.c +++ b/upnp/src/gena/gena_device.c @@ -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("\n\n"); - for (temp_counter = 0, counter = 0; counter < count; counter++) { + for (counter = 0; counter < count; counter++) { size += strlen( "\n\n" ); size += 2 * strlen(names[counter]) + strlen(values[counter]) + diff --git a/upnp/src/genlib/net/http/httpreadwrite.c b/upnp/src/genlib/net/http/httpreadwrite.c index 983a29c..b872ede 100644 --- a/upnp/src/genlib/net/http/httpreadwrite.c +++ b/upnp/src/genlib/net/http/httpreadwrite.c @@ -126,7 +126,7 @@ static int Check_Connect_And_Wait_Connection( #ifndef WIN32 } else { int valopt = 0; - socklen_t len = 0; + socklen_t len = sizeof(valopt); if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (void *) &valopt, &len) < 0) { /* failed to read delayed error */ return -1; @@ -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)) diff --git a/upnp/src/genlib/service_table/service_table.c b/upnp/src/genlib/service_table/service_table.c index 3f09976..5b173f3 100644 --- a/upnp/src/genlib/service_table/service_table.c +++ b/upnp/src/genlib/service_table/service_table.c @@ -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, diff --git a/upnp/src/ssdp/ssdp_ctrlpt.c b/upnp/src/ssdp/ssdp_ctrlpt.c index 9e51700..c82a320 100644 --- a/upnp/src/ssdp/ssdp_ctrlpt.c +++ b/upnp/src/ssdp/ssdp_ctrlpt.c @@ -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: diff --git a/upnp/src/ssdp/ssdp_device.c b/upnp/src/ssdp/ssdp_device.c index a439005..d00efb5 100644 --- a/upnp/src/ssdp/ssdp_device.c +++ b/upnp/src/ssdp/ssdp_device.c @@ -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); diff --git a/upnp/src/ssdp/ssdp_server.c b/upnp/src/ssdp/ssdp_server.c index 01c873f..231c2c5 100644 --- a/upnp/src/ssdp/ssdp_server.c +++ b/upnp/src/ssdp/ssdp_server.c @@ -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));