Compare commits

..

10 Commits

Author SHA1 Message Date
Marcelo Roberto Jimenez
6ac867bbb1 Fix the library numbers for release. 2010-11-07 01:33:18 -02:00
Marcelo Roberto Jimenez
9052ca95be Fix broken Makefile.am and remove unused file utilall.h. 2010-11-06 19:41:47 -02:00
Marcelo Roberto Jimenez
ef7edf6cf8 Fix for "SampleUtil_Initialize was called multiple times!" bug.
Fix for bug introduced in samples code in svn revision 502, commit
git:25c908c558c8e60eb386c155a6b93add447ffec0

Sample device and combo were aborting with the message:
"***** SampleUtil_Initialize was called multiple times!"
2010-11-06 00:45:24 -02:00
Fabrice Fontaine
c65ec8a720 Make multiple SSDP advertisements faster.
Put the loop to send multiple copies of each SSDP advertisements in
ssdp_server.c instead of ssdp_device.c so we have only one call to
imillisleep ( SSDP_PAUSE ) to speed up advertisements.
2010-11-05 23:52:17 -02:00
Fabrice Fontaine
2d22e997e1 Removing unused NUM_COPY variable.
Previously, NUM_COPY was used in ssdp_device.c to send multiple copies
of each advertisements but also multiple replies to each M-SEARCH
request. As sending multiple replies is not compliant with HTTPU/MU
spec, NUM_COPY has been set to 1 in an older patch. However, as this
variable is not needed and has been replaced with SSDP_COPY, it has
been removed.
2010-11-05 23:52:11 -02:00
Fabrice Fontaine
96dc968f18 Use SSDP_COPY to send multiple SSDP advertisements.
Currently, SSDP_COPY is used only to send multiple M-SEARCH requests (in
ssdp_ctrlpt.c). With this patch, SSDP_COPY is also used to send multiple
copies of each advertisements packets (in ssdp_device.c).
2010-11-05 13:25:40 -02:00
Carl Benson
8e846368e0 patch for taking notice of UPNP_USE_RWLOCK flag in threadutil
By "Carl Benson" <carl.benson@windriver.com>:

I had to do some modifications myself though, because the Android
build system insists on having a file named "util.h" taking precedence
in its include path, libupnp gets confused because of the same filename
in upnp/src/inc/util.h
2010-11-01 01:06:11 -02:00
Marcelo Roberto Jimenez
d6671c464f Bump config to 1.6.9. 2010-11-01 01:03:40 -02:00
Marcelo Roberto Jimenez
699dd3c82e Missed this line in configure.ac in the homekeeping commit. 2010-10-21 09:55:54 -02:00
Marcelo Roberto Jimenez
9be360bcd1 Homekeeping for the next release. 2010-10-20 11:15:23 -02:00
30 changed files with 347 additions and 320 deletions

View File

@@ -1,3 +1,51 @@
*******************************************************************************
Version 1.6.9
*******************************************************************************
2010-10-20 Marcelo Roberto Jimenez <mroberto(at)users.sourceforge.net>
Fix for bug introduced in samples code in svn revision 502, commit
git:25c908c558c8e60eb386c155a6b93add447ffec0
Sample device and combo were aborting with the message:
"***** SampleUtil_Initialize was called multiple times!"
2010-11-08 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
Make multiple SSDP advertisements faster.
Put the loop to send multiple copies of each SSDP advertisements in
ssdp_server.c instead of ssdp_device.c so we have only one call to
imillisleep ( SSDP_PAUSE ) to speed up advertisements.
2010-11-05 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
Removing unused NUM_COPY variable.
Previously, NUM_COPY was used in ssdp_device.c to send multiple copies
of each advertisements but also multiple replies to each M-SEARCH
request. As sending multiple replies is not compliant with HTTPU/MU
spec, NUM_COPY has been set to 1 in an older patch. However, as this
variable is not needed and has been replaced with SSDP_COPY, it has
been removed.
2010-11-05 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
Use SSDP_COPY to send multiple SSDP advertisements.
Currently, SSDP_COPY is used only to send multiple M-SEARCH requests (in
ssdp_ctrlpt.c). With this patch, SSDP_COPY is also used to send multiple
copies of each advertisements packets (in ssdp_device.c).
2010-11-01 Carl Benson <carl.benson(at)windriver.com>
Fix for Android build.
I had to do some modifications myself though, because the Android
build system insists on having a file named "util.h" taking precedence
in its include path, libupnp gets confused because of the same filename
in upnp/src/inc/util.h
*******************************************************************************
Version 1.6.8
*******************************************************************************

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = libUPnP
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.6.8
PROJECT_NUMBER = 1.6.9
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

1
THANKS
View File

@@ -13,6 +13,7 @@ exempt of errors.
- Arno Willig
- Bob Ciora
- Carlo Parata
- Carl Benson
- Chandra (inactiveneurons)
- Chaos
- Charles Nepveu (cnepveu)

View File

@@ -105,13 +105,13 @@
#define PACKAGE_NAME "libupnp"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libupnp 1.6.8"
#define PACKAGE_STRING "libupnp 1.6.9"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libupnp"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.6.8"
#define PACKAGE_VERSION "1.6.9"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
@@ -151,13 +151,13 @@
#define UPNP_VERSION_MINOR 6
/* see upnpconfig.h */
#define UPNP_VERSION_PATCH 8
#define UPNP_VERSION_PATCH 9
/* see upnpconfig.h */
#define UPNP_VERSION_STRING "1.6.8"
#define UPNP_VERSION_STRING "1.6.9"
/* Version number of package */
#define VERSION "1.6.8"
#define VERSION "1.6.9"
/* File Offset size */
#define _FILE_OFFSET_BITS 64

View File

@@ -40,7 +40,7 @@
***************************************************************************/
/** The library version (string) e.g. "1.3.0" */
#define UPNP_VERSION_STRING "1.6.8"
#define UPNP_VERSION_STRING "1.6.9"
/** Major version of the library */
#define UPNP_VERSION_MAJOR 1
@@ -49,7 +49,7 @@
#define UPNP_VERSION_MINOR 6
/** Patch version of the library */
#define UPNP_VERSION_PATCH 8
#define UPNP_VERSION_PATCH 9
/** The library version (numeric) e.g. 10300 means version 1.3.0 */
#define UPNP_VERSION \

View File

@@ -9,7 +9,7 @@
AC_PREREQ(2.60)
AC_INIT([libupnp], [1.6.8], [mroberto@users.sourceforge.net])
AC_INIT([libupnp], [1.6.9], [mroberto@users.sourceforge.net])
dnl ############################################################################
dnl # *Independently* of the above libupnp package version, the libtool version
dnl # of the 3 libraries need to be updated whenever there is a change released:
@@ -175,14 +175,28 @@ dnl # - Code has changed in threadutil
dnl # revision: 0 -> 1
dnl # - Code has changed in upnp
dnl # revision: 0 -> 1
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:5:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [5:1:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [4:1:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.9:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in threadutil
dnl # revision: 1 -> 2
dnl # - Code has changed in upnp
dnl # revision: 1 -> 2
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:5:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [5:2:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [4:2:0])
dnl #
############################################################################
AC_SUBST([LT_VERSION_IXML], [2:5:0])
AC_SUBST([LT_VERSION_THREADUTIL], [5:1:2])
AC_SUBST([LT_VERSION_UPNP], [4:1:0])
AC_SUBST([LT_VERSION_THREADUTIL], [5:2:2])
AC_SUBST([LT_VERSION_UPNP], [4:2:0])
dnl ############################################################################
dnl # Repeating the algorithm to place it closer to the modificatin place:
dnl # - library code modified: revision++

View File

@@ -1,4 +1,4 @@
Version: 1.6.8
Version: 1.6.9
Summary: Universal Plug and Play (UPnP) SDK
Name: libupnp
Release: 1%{?dist}

View File

@@ -189,6 +189,9 @@ typedef pthread_rwlockattr_t ithread_rwlockattr_t;
***************************************************************************/
#if UPNP_USE_RWLOCK
typedef pthread_rwlock_t ithread_rwlock_t;
#else
/* Read-write locks aren't available: use mutex instead. */
typedef ithread_mutex_t ithread_rwlock_t;
#endif /* UPNP_USE_RWLOCK */
@@ -337,7 +340,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
#else
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
#endif
#endif /* UPNP_USE_RWLOCK */
/****************************************************************************
* Function: ithread_mutexattr_getkind_np
@@ -362,7 +365,7 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
#else
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
#endif
#endif /* UPNP_USE_RWLOCK */
/****************************************************************************
@@ -536,8 +539,10 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
*****************************************************************************/
#if UPNP_USE_RWLOCK
#define ithread_rwlock_init pthread_rwlock_init
#endif /* UPNP_USE_RWLOCK */
#else
/* Read-write locks aren't available: use mutex instead. */
#define ithread_rwlock_init ithread_mutex_init
#endif
/****************************************************************************
* Function: ithread_rwlock_rdlock
@@ -555,9 +560,11 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
*****************************************************************************/
#if UPNP_USE_RWLOCK
#define ithread_rwlock_rdlock pthread_rwlock_rdlock
#else
/* Read-write locks aren't available: use mutex instead. */
#define ithread_rwlock_rdlock ithread_mutex_lock
#endif /* UPNP_USE_RWLOCK */
/****************************************************************************
* Function: ithread_rwlock_wrlock
*
@@ -574,6 +581,9 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
*****************************************************************************/
#if UPNP_USE_RWLOCK
#define ithread_rwlock_wrlock pthread_rwlock_wrlock
#else
/* Read-write locks aren't available: use mutex instead. */
#define ithread_rwlock_wrlock ithread_mutex_lock
#endif /* UPNP_USE_RWLOCK */
@@ -594,6 +604,9 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
*****************************************************************************/
#if UPNP_USE_RWLOCK
#define ithread_rwlock_unlock pthread_rwlock_unlock
#else
/* Read-write locks aren't available: use mutex instead. */
#define ithread_rwlock_unlock ithread_mutex_unlock
#endif /* UPNP_USE_RWLOCK */
@@ -615,6 +628,9 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
*****************************************************************************/
#if UPNP_USE_RWLOCK
#define ithread_rwlock_destroy pthread_rwlock_destroy
#else
/* Read-write locks aren't available: use mutex instead. */
#define ithread_rwlock_destroy ithread_mutex_destroy
#endif /* UPNP_USE_RWLOCK */

View File

@@ -70,8 +70,7 @@ libupnp_la_SOURCES = \
src/inc/upnp_timeout.h \
src/inc/uri.h \
src/inc/urlconfig.h \
src/inc/util.h \
src/inc/utilall.h \
src/inc/upnputil.h \
src/inc/uuid.h \
src/inc/VirtualDir.h \
src/inc/webserver.h

View File

@@ -82,9 +82,6 @@ int SampleUtil_Initialize(print_string print_function)
ithread_mutex_unlock(&display_mutex);
initialize_init = 0;
} else {
SampleUtil_Print("***** SampleUtil_Initialize was called multiple times!\n");
abort();
}
return UPNP_E_SUCCESS;

View File

@@ -122,6 +122,7 @@ ithread_mutex_t GlobalClientSubscribeMutex;
/*! rwlock to synchronize handles (root device or control point handle). */
ithread_rwlock_t GlobalHndRWLock;
/*! Mutex to synchronize the uuid creation process. */
ithread_mutex_t gUUIDMutex;

View File

@@ -57,7 +57,7 @@
#include "ThreadPool.h"
#include "unixutil.h" /* for socklen_t, EAFNOSUPPORT */
#include "upnpapi.h"
#include "util.h"
#include "upnputil.h"
#include <assert.h>

View File

@@ -36,7 +36,7 @@
#include "config.h"
#include <assert.h>
#include "util.h"
#include "upnputil.h"
#include "membuffer.h"
#include "httpparser.h"
#include "statcodes.h"

View File

@@ -37,7 +37,7 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include "util.h"
#include "upnputil.h"
#include "statcodes.h"
#ifdef WIN32

View File

@@ -51,7 +51,7 @@
#include "unixutil.h"
#include "upnp.h"
#include "upnpapi.h"
#include "util.h"
#include "upnputil.h"
#include "VirtualDir.h"
#include <assert.h>

View File

@@ -37,7 +37,7 @@
#include "config.h"
#include "upnp.h"
#include "util.h"
#include "upnputil.h"
#include <string.h>

View File

@@ -42,7 +42,7 @@
#include "LinkedList.h"
#include "membuffer.h"
#include "uri.h"
#include "util.h"
#include "upnputil.h"
////// private types ////////////

View File

@@ -33,7 +33,7 @@
#define GENLIB_NET_HTTP_HTTPREADWRITE_H
#include "config.h"
#include "util.h"
#include "upnputil.h"
#include "sock.h"
#include "httpparser.h"

View File

@@ -34,7 +34,7 @@
#include <stdlib.h>
#include "util.h"
#include "upnputil.h"
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )

View File

@@ -32,7 +32,7 @@
#ifndef GENLIB_NET_HTTP_PARSETOOLS_H
#define GENLIB_NET_HTTP_PARSETOOLS_H
#include "util.h"
#include "upnputil.h"
#include "httpparser.h"

View File

@@ -36,7 +36,7 @@
* \file
*/
#include "util.h"
#include "upnputil.h"
#ifdef WIN32
/* Do not #include <netinet/in.h> */

View File

@@ -90,7 +90,6 @@ typedef enum SsdpCmdType{
#define SSDP_IPV6_SITELOCAL "FF05::C"
#define SSDP_PORT 1900
#define NUM_TRY 3
#define NUM_COPY 1
#define THREAD_LIMIT 50
#define COMMAND_LEN 300

View File

@@ -33,7 +33,7 @@
#define GENLIB_UTIL_STRINTMAP_H
#include <stdlib.h>
#include "util.h"
#include "upnputil.h"
// Util to map from a string to an integer and vice versa

View File

@@ -109,10 +109,8 @@ struct Handle_Info
#endif
};
extern ithread_rwlock_t GlobalHndRWLock;
/*!
* \brief Get handle information.
*

View File

@@ -1,34 +0,0 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2003 Intel Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////
#include <genlib/util/util.h>
#include <genlib/util/xstring.h>

View File

@@ -33,7 +33,7 @@
#include "config.h"
#include "util.h"
#include "upnputil.h"
#ifdef INCLUDE_CLIENT_APIS

View File

@@ -223,7 +223,6 @@ NewRequestHandler( IN struct sockaddr *DestAddr,
char errorBuffer[ERROR_BUFFER_LEN];
SOCKET ReplySock;
int socklen = sizeof( struct sockaddr_storage );
int NumCopy;
int Index;
unsigned long replyAddr = inet_addr( gIF_IPV4 );
int ttl = 4; // a/c to UPNP Spec
@@ -265,19 +264,6 @@ NewRequestHandler( IN struct sockaddr *DestAddr,
for( Index = 0; Index < NumPacket; Index++ ) {
int rc;
// The reason to keep this loop is purely historical/documentation,
// according to section 9.2 of HTTPU spec:
//
// "If a multicast resource would send a response(s) to any copy of the
// request, it SHOULD send its response(s) to each copy of the request
// it receives. It MUST NOT repeat its response(s) per copy of the
// request."
//
// http://www.upnp.org/download/draft-goland-http-udp-04.txt
//
// So, NUM_COPY has been changed from 2 to 1.
NumCopy = 0;
while( NumCopy < NUM_COPY ) {
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
">>> SSDP SEND to %s >>>\n%s\n",
buf_ntop, *( RqPacket + Index ) );
@@ -293,11 +279,6 @@ NewRequestHandler( IN struct sockaddr *DestAddr,
ret = UPNP_E_SOCKET_WRITE;
goto end_NewRequestHandler;
}
imillisleep( SSDP_PAUSE );
++NumCopy;
}
}
end_NewRequestHandler:
@@ -502,7 +483,7 @@ DeviceAdvertisement( IN char *DevType,
//char Mil_Nt[LINE_SIZE]
char Mil_Usn[LINE_SIZE];
char *msgs[3];
int ret_code;
int ret_code = UPNP_E_SUCCESS;
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"In function DeviceAdvertisement\n" );
@@ -751,7 +732,7 @@ ServiceAdvertisement( IN char *Udn,
{
char Mil_Usn[LINE_SIZE];
char *szReq[1];
int RetVal;
int RetVal = UPNP_E_SUCCESS;
struct sockaddr_storage __ss;
struct sockaddr_in* DestAddr4 = (struct sockaddr_in*)&__ss;
struct sockaddr_in6* DestAddr6 = (struct sockaddr_in6*)&__ss;
@@ -860,7 +841,7 @@ ServiceShutdown( IN char *Udn,
struct sockaddr_storage __ss;
struct sockaddr_in* DestAddr4 = (struct sockaddr_in*)&__ss;
struct sockaddr_in6* DestAddr6 = (struct sockaddr_in6*)&__ss;
int RetVal;
int RetVal = UPNP_E_SUCCESS;
memset( &__ss, 0, sizeof(__ss) );
if( AddressFamily == AF_INET ) {
@@ -926,7 +907,7 @@ DeviceShutdown( IN char *DevType,
struct sockaddr_in6* DestAddr6 = (struct sockaddr_in6*)&__ss;
char *msgs[3];
char Mil_Usn[LINE_SIZE];
int ret_code;
int ret_code = UPNP_E_SUCCESS;
msgs[0] = NULL;
msgs[1] = NULL;

View File

@@ -135,6 +135,7 @@ int AdvertiseAndReply(
const DOMString tmpStr;
char SERVER[200];
const DOMString dbgStr;
int NumCopy = 0;
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"Inside AdvertiseAndReply with AdFlag = %d\n", AdFlag);
@@ -152,6 +153,11 @@ int AdvertiseAndReply(
get_sdk_info(SERVER);
/* parse the device list and send advertisements/replies */
while (NumCopy == 0 || (AdFlag && NumCopy < NUM_SSDP_COPY)) {
if (NumCopy != 0)
imillisleep(SSDP_PAUSE);
NumCopy++;
for (i = 0;; i++) {
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"Entering new device list with i = %d\n\n", i);
@@ -392,6 +398,7 @@ int AdvertiseAndReply(
ixmlNodeList_free(nodeList);
nodeList = NULL;
}
}
end_function:
ixmlNodeList_free(tmpNodeList);

View File

@@ -40,7 +40,7 @@
#include "UpnpInet.h"
#include "uri.h"
#include "urlconfig.h"
#include "util.h"
#include "upnputil.h"
#include "webserver.h"