Compare commits
44 Commits
release-1.
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
62903b80f0 | ||
![]() |
6080414dc9 | ||
![]() |
6cbd7f0159 | ||
![]() |
c7c493c043 | ||
![]() |
c2f8e8789a | ||
![]() |
76457d0187 | ||
![]() |
9f5d49f9fd | ||
![]() |
cad4d05cd7 | ||
![]() |
26b8968e0c | ||
![]() |
d2eaa23b59 | ||
![]() |
b8aec74782 | ||
![]() |
851cfbc4db | ||
![]() |
f42bbb6dc2 | ||
![]() |
bd6027c3d1 | ||
![]() |
e3865bf6b6 | ||
![]() |
27af41e562 | ||
![]() |
1f05f5d6cc | ||
![]() |
43b9760840 | ||
![]() |
0103424b91 | ||
![]() |
13a1fff7a1 | ||
![]() |
c9463545a8 | ||
![]() |
de1d7e81a3 | ||
![]() |
f87dbf8115 | ||
![]() |
83ee32afb7 | ||
![]() |
4f960c4e34 | ||
![]() |
c85537df11 | ||
![]() |
20905cb7a7 | ||
![]() |
5b744169d5 | ||
![]() |
c69e16b347 | ||
![]() |
cb7e6b7472 | ||
![]() |
fd80e5a8ff | ||
![]() |
b29de32110 | ||
![]() |
6455ac6eea | ||
![]() |
f7bb1f9582 | ||
![]() |
0728ab3b25 | ||
![]() |
cb9ee8254c | ||
![]() |
f08fdac9b6 | ||
![]() |
0db035cc7b | ||
![]() |
da11e52924 | ||
![]() |
bc7b0c9d4d | ||
![]() |
b2757d9d55 | ||
![]() |
7967a0cd45 | ||
![]() |
67b51187b9 | ||
![]() |
491f5ffef6 |
69
ChangeLog
69
ChangeLog
@@ -1,70 +1,3 @@
|
||||
*******************************************************************************
|
||||
Version 1.6.4
|
||||
*******************************************************************************
|
||||
|
||||
2008-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Workaround for a problem with the new automake AM_CONDITIONAL macro
|
||||
from autotools-1.10. Thanks to Ingo Hofmann for helping with debugging
|
||||
this one.
|
||||
|
||||
2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Added quoting to macros AC_CONFIG_AUX_DIR, AC_CONFIG_MACRO_DIR and
|
||||
AC_CONFIG_SRCDIR in configure.ac. Also changed the name of the
|
||||
auxiliary directory in AC_CONFIG_AUX_DIR to build-aux.
|
||||
|
||||
2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Fix for setsockopt() in Threadpool.c to allow more than one process
|
||||
to join the multicast-group on OSX. Thanks to Ingo Hofmann.
|
||||
|
||||
2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Using defined(__OSX__) || defined(__APPLE__) instead of just
|
||||
defined(__OSX__) in the code. Thanks to Ingo Hofmann and Chris
|
||||
Pickel.
|
||||
|
||||
2008-01-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Fix for isFileInVirtualDir. Thanks to Peter Hartley for the patch.
|
||||
|
||||
2008-01-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Putting back a "defined(__OSX__)" that has been removed in the
|
||||
previous *BSD patch. Thanks to Chris Pickel for pointing it out.
|
||||
|
||||
2008-01-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* SF Patches Tracker [ 1865812 ] typo in docs comment
|
||||
Submitted By: Hartmut Holzgraefe - hholzgra
|
||||
typo in docs comment ACCAPTED instead of ACCEPTED in
|
||||
@name UPNP_E_UNSUBSCRIBE_UNACCAPTED [-302]
|
||||
Also, the documentation file name was mispelled and was corrected in
|
||||
the Makefile.am.
|
||||
|
||||
*******************************************************************************
|
||||
Version 1.6.3
|
||||
*******************************************************************************
|
||||
|
||||
2007-12-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Using pthread flags for the whole project, not just at the places
|
||||
individually indicated by several Makefile.am files spread all over
|
||||
the directories. That was too much error prone.
|
||||
|
||||
2007-12-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Added a configure test to check if pthread_rwlock_t is available.
|
||||
Define _GNU_SOURCE if needed. The fallback behaviou will only be
|
||||
implemented if _GNU_SOURCE prooves to be insufficient on some
|
||||
platforms. Thanks to Jonathan Casiot (no_dice) and Robert Gingher
|
||||
(robsbox).
|
||||
|
||||
2007-12-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Removed unused iasnprintf.{c,h} files.
|
||||
|
||||
2007-12-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Removed STATSONLY() macro from ThreadPool.{c,h}.
|
||||
* Removed time() usage from ThreadPool.c.
|
||||
* Fixed STATS = 0 compilation.
|
||||
|
||||
2007-12-16 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Library was not compiling on FreeBSD 7. Code now no longer uses
|
||||
ftime(), using gettimeofday() instead. Thanks to Josh Carroll.
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
Version 1.6.2
|
||||
*******************************************************************************
|
||||
@@ -425,7 +358,7 @@ Version 1.4.2
|
||||
2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
|
||||
* SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2
|
||||
Submitted By: Jonathan Casiot - no_dice
|
||||
Submitted By: Jonathan - no_dice
|
||||
Summary: This patch hopefully fixes the remaining types and related
|
||||
code to enable files >= 2 GiB to be streamed. Jonathan claims to have
|
||||
tested this with a patched version of ushare-0.9.8 and a D-Link DSM-520.
|
||||
|
12
THANKS
12
THANKS
@@ -10,7 +10,6 @@ exempt of errors.
|
||||
- Arno Willig
|
||||
- Bob Ciora
|
||||
- Chaos
|
||||
- Chris Pickel
|
||||
- Craig Nelson
|
||||
- David Maass
|
||||
- Emil Ljungdahl
|
||||
@@ -21,25 +20,20 @@ exempt of errors.
|
||||
- Fabrice Fontaine
|
||||
- Fredrik Svensson
|
||||
- Glen Masgai
|
||||
- Hartmut Holzgraefe - hholzgra
|
||||
- Ingo Hofmann
|
||||
- Jiri Zouhar
|
||||
- John Dennis
|
||||
- Jonathan Casiot (no_dice)
|
||||
- Josh Carroll
|
||||
- Jonathan (no_dice)
|
||||
- Keith Brindley
|
||||
- Leuk_He
|
||||
- Loigu
|
||||
- Luke Kim
|
||||
- Marcelo Roberto Jimenez (mroberto)
|
||||
- Markus Strobl
|
||||
- Nektarios K. Papadopoulos (npapadop)
|
||||
- Nektarios K. Papadopoulos
|
||||
- Oskar Liljeblad
|
||||
- Michael (oxygenic)
|
||||
- Michael (Oxy)
|
||||
- Paul Vixie
|
||||
- Peter Hartley
|
||||
- Rene Hexel
|
||||
- Robert Gingher (robsbox)
|
||||
- Siva Chandran
|
||||
- Stéphane Corthésy
|
||||
- Steve Bresson
|
||||
|
263
configure.ac
263
configure.ac
@@ -9,133 +9,108 @@
|
||||
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
AC_INIT([libupnp], [1.6.4], [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:
|
||||
dnl # "current:revision:age" (this is NOT the same as the package version),
|
||||
dnl # where:
|
||||
dnl # - library code modified: revision++
|
||||
dnl # - interfaces changed/added/removed: current++ and revision=0
|
||||
dnl # - interfaces added: age++
|
||||
dnl # - interfaces removed: age=0
|
||||
dnl # *please update only once, before a formal release, not for each change*
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.4.1:
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.4.6:
|
||||
dnl # "current:revision:age"
|
||||
dnl #
|
||||
dnl # - Code has changed in ixml
|
||||
dnl # revision: 2 -> 3
|
||||
dnl # - Code has changed in threadutil
|
||||
dnl # revision: 2 -> 3
|
||||
dnl # - Interface added in threadutil
|
||||
dnl # current: 2 -> 3
|
||||
dnl # revisiion: 3 -> 0
|
||||
dnl # age: 0 -> 1
|
||||
dnl # - Code has changed in upnp
|
||||
dnl # revision: 2 -> 3
|
||||
dnl #
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.6.0:
|
||||
dnl # "current:revision:age"
|
||||
dnl #
|
||||
dnl # - Code has changed in ixml
|
||||
dnl # revision: 3 -> 4
|
||||
dnl # - Code has changed in threadutil
|
||||
dnl # revision: 0 -> 1
|
||||
dnl # - Code has changed in upnp
|
||||
dnl # revision: 3 -> 4
|
||||
dnl # - Interface changed in upnp
|
||||
dnl # current: 2 -> 3
|
||||
dnl # revision: 4 -> 0
|
||||
dnl # - Interface removed in upnp
|
||||
dnl # age: 0 -> 0
|
||||
dnl #
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:0:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.6.1:
|
||||
dnl # "current:revision:age"
|
||||
dnl #
|
||||
dnl # - Code has changed in threadutil
|
||||
dnl # revision: 1 -> 2
|
||||
dnl # - Interface added in threadutil
|
||||
dnl # current: 3 -> 4
|
||||
dnl # revision: 2 -> 0
|
||||
dnl # - Interface added in threadutil
|
||||
dnl # age: 1 -> 2
|
||||
dnl # - Code has changed in upnp
|
||||
dnl # revision: 0 -> 1
|
||||
dnl #
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:1:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.6.2:
|
||||
dnl # "current:revision:age"
|
||||
dnl #
|
||||
dnl # - Code has changed in upnp
|
||||
dnl # revision: 1 -> 2
|
||||
dnl #
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:2:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.6.3:
|
||||
dnl # "current:revision:age"
|
||||
dnl #
|
||||
dnl # - Code has changed in threadutil
|
||||
dnl # revision: 0 -> 1
|
||||
dnl #
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:1:2])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:2:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
dnl # Release 1.6.4:
|
||||
dnl # "current:revision:age"
|
||||
dnl #
|
||||
dnl # - Code has changed in threadutil
|
||||
dnl # revision: 1 -> 2
|
||||
dnl # - Code has changed in upnp
|
||||
dnl # revision: 2 -> 3
|
||||
dnl #
|
||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
|
||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:3:0])
|
||||
dnl #
|
||||
dnl ############################################################################
|
||||
AC_INIT([libupnp], [1.6.2], [mroberto@users.sourceforge.net])
|
||||
###############################################################################
|
||||
# *Independently* of the above libupnp package version, the libtool version
|
||||
# of the 3 libraries need to be updated whenever there is a change released:
|
||||
# "current:revision:age" (this is NOT the same as the package version), where:
|
||||
# - library code modified: revision++
|
||||
# - interfaces changed/added/removed: current++ and revision=0
|
||||
# - interfaces added: age++
|
||||
# - interfaces removed: age=0
|
||||
# *please update only once, before a formal release, not for each change*
|
||||
#
|
||||
###############################################################################
|
||||
# Release 1.4.1:
|
||||
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
||||
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
||||
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
||||
#
|
||||
###############################################################################
|
||||
# Release 1.4.6:
|
||||
# "current:revision:age"
|
||||
#
|
||||
# - Code has changed in ixml
|
||||
# revision: 2 -> 3
|
||||
# - Code has changed in threadutil
|
||||
# revision: 2 -> 3
|
||||
# - Interface added in threadutil
|
||||
# current: 2 -> 3
|
||||
# revisiion: 3 -> 0
|
||||
# age: 0 -> 1
|
||||
# - Code has changed in upnp
|
||||
# revision: 2 -> 3
|
||||
#
|
||||
#AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
||||
#AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
||||
#AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
||||
#
|
||||
###############################################################################
|
||||
# Release 1.6.0:
|
||||
# "current:revision:age"
|
||||
#
|
||||
# - Code has changed in ixml
|
||||
# revision: 3 -> 4
|
||||
# - Code has changed in threadutil
|
||||
# revision: 0 -> 1
|
||||
# - Code has changed in upnp
|
||||
# revision: 3 -> 4
|
||||
# - Interface changed in upnp
|
||||
# current: 2 -> 3
|
||||
# revision: 4 -> 0
|
||||
# - Interface removed in upnp
|
||||
# age: 0 -> 0
|
||||
#
|
||||
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
#AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1])
|
||||
#AC_SUBST([LT_VERSION_UPNP], [3:0:0])
|
||||
#
|
||||
###############################################################################
|
||||
# Release 1.6.1:
|
||||
# "current:revision:age"
|
||||
#
|
||||
# - Code has changed in threadutil
|
||||
# revision: 1 -> 2
|
||||
# - Interface added in threadutil
|
||||
# current: 3 -> 4
|
||||
# revision: 2 -> 0
|
||||
# - Interface added in threadutil
|
||||
# age: 1 -> 2
|
||||
# - Code has changed in upnp
|
||||
# revision: 0 -> 1
|
||||
#
|
||||
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
#AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||
#AC_SUBST([LT_VERSION_UPNP], [3:1:0])
|
||||
#
|
||||
###############################################################################
|
||||
# Release 1.6.2:
|
||||
# "current:revision:age"
|
||||
#
|
||||
# - Code has changed in upnp
|
||||
# revision: 1 -> 2
|
||||
#
|
||||
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
#AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||
#AC_SUBST([LT_VERSION_UPNP], [3:2:0])
|
||||
#
|
||||
###############################################################################
|
||||
AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||
AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
|
||||
AC_SUBST([LT_VERSION_UPNP], [3:3:0])
|
||||
dnl ############################################################################
|
||||
dnl # Repeating the algorithm to place it closer to the modificatin place:
|
||||
dnl # - library code modified: revision++
|
||||
dnl # - interfaces changed/added/removed: current++ and revision=0
|
||||
dnl # - interfaces added: age++
|
||||
dnl # - interfaces removed: age=0
|
||||
dnl # *please update only once, before a formal release, not for each change*
|
||||
dnl ############################################################################
|
||||
AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||
AC_SUBST([LT_VERSION_UPNP], [3:2:0])
|
||||
###############################################################################
|
||||
# Repeating the algorithm so that it is closer to the modificatin place:
|
||||
# - library code modified: revision++
|
||||
# - interfaces changed/added/removed: current++ and revision=0
|
||||
# - interfaces added: age++
|
||||
# - interfaces removed: age=0
|
||||
# *please update only once, before a formal release, not for each change*
|
||||
###############################################################################
|
||||
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_SRCDIR([upnp/inc/upnp.h])
|
||||
AC_CONFIG_AUX_DIR(config.aux)
|
||||
AC_CONFIG_MACRO_DIR(m4)
|
||||
AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
|
||||
|
||||
|
||||
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
|
||||
@@ -165,7 +140,8 @@ AC_REVISION([$Revision: 1.11 $])
|
||||
upnpmaj=`echo "$PACKAGE_VERSION" | sed 's/\..*//' `
|
||||
upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `]
|
||||
upnppatch=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.[^.]\.// ; s/[^0-9].*$//' `]
|
||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION", [see upnpconfig.h])
|
||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION",
|
||||
[see upnpconfig.h])
|
||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_MAJOR], $upnpmaj, [see upnpconfig.h])
|
||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h])
|
||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h])
|
||||
@@ -187,6 +163,7 @@ fi
|
||||
#
|
||||
# Check for libupnp subsets
|
||||
#
|
||||
|
||||
RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)])
|
||||
if test "x$enable_client" = xyes ; then
|
||||
AC_DEFINE(UPNP_HAVE_CLIENT, 1, [see upnpconfig.h])
|
||||
@@ -220,13 +197,11 @@ fi
|
||||
RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
|
||||
|
||||
|
||||
#
|
||||
# doc installation
|
||||
# autoconf >= 2.60 already defines ${docdir}, but we will not use its
|
||||
# default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}.
|
||||
# That would give us ${datarootdir}/doc/libupnp, and we want the package
|
||||
# version on that.
|
||||
#
|
||||
docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"
|
||||
AC_MSG_CHECKING([for documentation directory])
|
||||
AC_ARG_WITH(
|
||||
@@ -241,9 +216,7 @@ AS_HELP_STRING(
|
||||
[],
|
||||
[with_documentation=no])
|
||||
|
||||
#
|
||||
# If something has been entered after an equal sign, assume it is the directory
|
||||
#
|
||||
if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then
|
||||
docdir="$with_documentation"
|
||||
fi
|
||||
@@ -329,6 +302,7 @@ AC_CHECK_HEADERS(
|
||||
# Checks for typedefs, structures, and compiler characteristics
|
||||
#
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
TYPE_SOCKLEN_T
|
||||
|
||||
|
||||
@@ -343,40 +317,9 @@ AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)])
|
||||
#
|
||||
# Checks for POSIX Threads
|
||||
#
|
||||
echo "--------------------------- pthread stuff -------------------------------------"
|
||||
ACX_PTHREAD(
|
||||
[],
|
||||
[AC_MSG_ERROR([POSIX threads are required to build this program])])
|
||||
#
|
||||
# Update environment variables for pthreads
|
||||
#
|
||||
CC="$PTHREAD_CC"
|
||||
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
#
|
||||
# Determine if pthread_rwlock_t is available
|
||||
#
|
||||
echo "----------------------- pthread_rwlock_t stuff --------------------------------"
|
||||
AC_MSG_CHECKING([if pthread_rwlock_t is available])
|
||||
AC_LANG([C])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <pthread.h>],
|
||||
[pthread_rwlock_t *x;])],
|
||||
[AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
|
||||
AC_MSG_RESULT([yes, supported without any options])],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#define _GNU_SOURCE
|
||||
#include <pthread.h>],
|
||||
[pthread_rwlock_t *x;])],
|
||||
[AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t])
|
||||
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
||||
AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])],
|
||||
[AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t])
|
||||
AC_MSG_RESULT([no, needs to fallback to pthread_mutex])
|
||||
AC_MSG_ERROR([pthread_rwlock_t not available])])])
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
|
4
docs/dist/Makefile.am
vendored
4
docs/dist/Makefile.am
vendored
@@ -39,7 +39,7 @@ EXTRA_DIST = \
|
||||
./html/upnp/UPNP_E_SOCKET_ERROR-208.html \
|
||||
./html/upnp/UPNP_E_CANCELED-210.html \
|
||||
./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \
|
||||
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-302.html \
|
||||
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCAPTED-302.html \
|
||||
./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \
|
||||
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
|
||||
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \
|
||||
@@ -295,7 +295,7 @@ if WITH_DOCUMENTATION
|
||||
./html/upnp/UPNP_E_SOCKET_ERROR-208.html \
|
||||
./html/upnp/UPNP_E_CANCELED-210.html \
|
||||
./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \
|
||||
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-302.html \
|
||||
./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCAPTED-302.html \
|
||||
./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \
|
||||
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
|
||||
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \
|
||||
|
@@ -38,6 +38,10 @@
|
||||
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
|
||||
#ifndef WIN32
|
||||
#define UPNP_INLINE inline
|
||||
#endif
|
||||
|
||||
#define MEMBUF_DEF_SIZE_INC 20
|
||||
|
||||
|
||||
|
@@ -501,22 +501,17 @@ Parser_init( )
|
||||
}
|
||||
|
||||
/*================================================================
|
||||
* Parser_isValidEndElement
|
||||
* check if a new node->nodeName matches top of element stack.
|
||||
* Internal to parser only.
|
||||
*=================================================================*/
|
||||
* Parser_isValidEndElement
|
||||
* check if a new node->nodeName matches top of element stack.
|
||||
* Internal to parser only.
|
||||
*
|
||||
*=================================================================*/
|
||||
static int
|
||||
Parser_isValidEndElement(
|
||||
IN Parser * xmlParser,
|
||||
Parser_isValidEndElement( IN Parser * xmlParser,
|
||||
IN IXML_Node * newNode )
|
||||
{
|
||||
assert( xmlParser );
|
||||
assert( xmlParser->pCurElement );
|
||||
assert( xmlParser->pCurElement->element );
|
||||
assert( newNode );
|
||||
assert( newNode->nodeName );
|
||||
|
||||
return strcmp( xmlParser->pCurElement->element, newNode->nodeName ) == 0;
|
||||
return ( strcmp( xmlParser->pCurElement->element, newNode->nodeName )
|
||||
== 0 );
|
||||
}
|
||||
|
||||
/*===============================================================
|
||||
@@ -926,8 +921,6 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
||||
int rc = IXML_SUCCESS;
|
||||
IXML_CDATASection *cdataSecNode = NULL;
|
||||
|
||||
// It is important that the node gets initialized here, otherwise things
|
||||
// can go wrong on the error handler.
|
||||
ixmlNode_init( &newNode );
|
||||
|
||||
rc = ixmlDocument_createDocumentEx( &gRootDoc );
|
||||
@@ -943,9 +936,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
||||
}
|
||||
|
||||
while( bETag == FALSE ) {
|
||||
// clear the newNode contents. Redundant on the first iteration,
|
||||
// but nonetheless, necessary due to the possible calls to
|
||||
// ErrorHandler above. Currently, this is just a memset to zero.
|
||||
// clear the newNode contents
|
||||
ixmlNode_init( &newNode );
|
||||
|
||||
if( Parser_getNextNode( xmlParser, &newNode, &bETag ) ==
|
||||
@@ -1039,7 +1030,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
||||
Parser_free( xmlParser );
|
||||
return rc;
|
||||
|
||||
ErrorHandler:
|
||||
ErrorHandler:
|
||||
Parser_freeNodeContent( &newNode );
|
||||
ixmlDocument_free( gRootDoc );
|
||||
Parser_free( xmlParser );
|
||||
@@ -2506,4 +2497,3 @@ Parser_getNextNode( IN Parser * xmlParser,
|
||||
return IXML_SYNTAX_ERR;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Version: 1.6.4
|
||||
Version: 1.6.2
|
||||
Summary: Universal Plug and Play (UPnP) SDK
|
||||
Name: libupnp
|
||||
Release: 1%{?dist}
|
||||
|
@@ -41,7 +41,7 @@ AC_DEFUN([RT_BOOL_ARG_ENABLE],[
|
||||
)])
|
||||
test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl
|
||||
&& enable_[]Name=[$2]
|
||||
AC_MSG_RESULT($enable_[]Name)
|
||||
AC_MSG_RESULT($enable_[]Name)dnl
|
||||
AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes)
|
||||
dnl
|
||||
m4_popdef([NAME])dnl
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc
|
||||
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||
|
||||
if ENABLE_DEBUG
|
||||
AM_CPPFLAGS += -DDEBUG -DSTATS
|
||||
@@ -20,11 +21,12 @@ libthreadutil_la_LDFLAGS = -version-info $(LT_VERSION_THREADUTIL)
|
||||
|
||||
libthreadutil_la_SOURCES = \
|
||||
src/FreeList.c src/LinkedList.c \
|
||||
src/ThreadPool.c src/TimerThread.c
|
||||
src/ThreadPool.c src/TimerThread.c \
|
||||
src/iasnprintf.c
|
||||
|
||||
upnpincludedir = $(includedir)/upnp
|
||||
upnpinclude_HEADERS = \
|
||||
inc/FreeList.h inc/LinkedList.h \
|
||||
inc/ThreadPool.h inc/TimerThread.h \
|
||||
inc/ithread.h
|
||||
inc/iasnprintf.h inc/ithread.h
|
||||
|
||||
|
@@ -32,12 +32,6 @@
|
||||
#ifndef THREADPOOL_H
|
||||
#define THREADPOOL_H
|
||||
|
||||
#ifdef UPNP_USE_MSVCPP
|
||||
#define UPNP_INLINE
|
||||
#else
|
||||
#define UPNP_INLINE inline
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -70,23 +64,32 @@ typedef enum priority {LOW_PRIORITY,
|
||||
#define DEFAULT_FREE_ROUTINE NULL /* default free routine used TPJobInit */
|
||||
#define DEFAULT_MAX_JOBS_TOTAL 100 /* default max jobs used TPAttrInit */
|
||||
|
||||
#define STATS 1 /* always include stats because code change is minimal */
|
||||
|
||||
|
||||
/* Statistics */
|
||||
/* always include stats because code change is minimal */
|
||||
#define STATS 1
|
||||
#ifdef WIN32 /* TODO: check why STATSONLY fails during compilation */
|
||||
#undef STATS
|
||||
#endif
|
||||
|
||||
#ifdef STATS
|
||||
#define STATSONLY(x) x
|
||||
#else
|
||||
#define STATSONLY(x)
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define DEBUG 1
|
||||
#endif
|
||||
|
||||
#include "LinkedList.h"
|
||||
#include <sys/time.h> /* for gettimeofday() */
|
||||
#include <sys/timeb.h>
|
||||
#include "FreeList.h"
|
||||
|
||||
#include "ithread.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/timeb.h>
|
||||
#define EXPORT
|
||||
|
||||
typedef int PolicyType;
|
||||
#define DEFAULT_POLICY SCHED_OTHER
|
||||
#define DEFAULT_SCHED_PARAM 0 /* default priority */
|
||||
@@ -108,28 +111,26 @@ typedef void (*free_routine)(void *arg);
|
||||
*****************************************************************************/
|
||||
typedef struct THREADPOOLATTR
|
||||
{
|
||||
/* minThreads, ThreadPool will always maintain at least this many threads */
|
||||
int minThreads;
|
||||
int minThreads; /* minThreads, ThreadPool will always maintain at least
|
||||
this many threads */
|
||||
|
||||
/* maxThreads, ThreadPool will never have more than this number of threads */
|
||||
int maxThreads;
|
||||
int maxThreads; /* maxThreads, ThreadPool will never have more than this
|
||||
number of threads */
|
||||
|
||||
/* maxIdleTime (in milliseconds) this is the maximum time a thread will
|
||||
* remain idle before dying */
|
||||
int maxIdleTime;
|
||||
int maxIdleTime; /* maxIdleTime (in milliseconds)
|
||||
this is the maximum time a thread will remain idle
|
||||
before dying */
|
||||
|
||||
/* jobs per thread to maintain */
|
||||
int jobsPerThread;
|
||||
int jobsPerThread; /* jobs per thread to maintain */
|
||||
|
||||
/* maximum number of jobs that can be queued totally. */
|
||||
int maxJobsTotal;
|
||||
int maxJobsTotal; /* maximum number of jobs that can be queued totally. */
|
||||
|
||||
/* the time a low priority or med priority job waits before getting bumped
|
||||
* up a priority (in milliseconds) */
|
||||
int starvationTime;
|
||||
int starvationTime; /* the time a low priority or med priority
|
||||
job waits before getting bumped
|
||||
up a priority (in milliseconds) */
|
||||
|
||||
PolicyType schedPolicy; /* scheduling policy to use */
|
||||
|
||||
/* scheduling policy to use */
|
||||
PolicyType schedPolicy;
|
||||
} ThreadPoolAttr;
|
||||
|
||||
/****************************************************************************
|
||||
@@ -143,7 +144,7 @@ typedef struct THREADPOOLJOB
|
||||
start_routine func;
|
||||
void *arg;
|
||||
free_routine free_func;
|
||||
struct timeval requestTime;
|
||||
struct timeb requestTime;
|
||||
int priority;
|
||||
int jobId;
|
||||
} ThreadPoolJob;
|
||||
@@ -155,6 +156,8 @@ typedef struct THREADPOOLJOB
|
||||
* Structure to hold statistics
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef STATS
|
||||
|
||||
typedef struct TPOOLSTATS
|
||||
{
|
||||
double totalTimeHQ;
|
||||
@@ -176,7 +179,9 @@ typedef struct TPOOLSTATS
|
||||
int currentJobsHQ;
|
||||
int currentJobsLQ;
|
||||
int currentJobsMQ;
|
||||
} ThreadPoolStats;
|
||||
}ThreadPoolStats;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
@@ -217,8 +222,11 @@ typedef struct THREADPOOL
|
||||
|
||||
ThreadPoolAttr attr; /* thread pool attributes */
|
||||
|
||||
#ifdef STATS
|
||||
/* statistics */
|
||||
ThreadPoolStats stats;
|
||||
#endif
|
||||
|
||||
} ThreadPool;
|
||||
|
||||
|
||||
@@ -259,7 +267,8 @@ typedef struct THREADPOOL
|
||||
* INVALID_POLICY if schedPolicy can't be set
|
||||
* EMAXTHREADS if minimum threads is greater than maximum threads
|
||||
*****************************************************************************/
|
||||
int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr);
|
||||
int ThreadPoolInit(ThreadPool *tp,
|
||||
ThreadPoolAttr *attr);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: ThreadPoolAddPersistent
|
||||
@@ -281,7 +290,9 @@ int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr);
|
||||
* EOUTOFMEM not enough memory to add job.
|
||||
* EMAXTHREADS not enough threads to add persistent job.
|
||||
*****************************************************************************/
|
||||
int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
||||
int ThreadPoolAddPersistent (ThreadPool*tp,
|
||||
ThreadPoolJob *job,
|
||||
int *jobId);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: ThreadPoolGetAttr
|
||||
@@ -296,7 +307,8 @@ int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
||||
* 0 on success, nonzero on failure
|
||||
* Always returns 0.
|
||||
*****************************************************************************/
|
||||
int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out);
|
||||
int ThreadPoolGetAttr(ThreadPool *tp,
|
||||
ThreadPoolAttr *out);
|
||||
/****************************************************************************
|
||||
* Function: ThreadPoolSetAttr
|
||||
*
|
||||
@@ -310,7 +322,8 @@ int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out);
|
||||
* 0 on success, nonzero on failure
|
||||
* Returns INVALID_POLICY if policy can not be set.
|
||||
*****************************************************************************/
|
||||
int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr);
|
||||
int ThreadPoolSetAttr(ThreadPool *tp,
|
||||
ThreadPoolAttr *attr);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: ThreadPoolAdd
|
||||
@@ -329,7 +342,9 @@ int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr);
|
||||
* 0 on success, nonzero on failure
|
||||
* EOUTOFMEM if not enough memory to add job.
|
||||
*****************************************************************************/
|
||||
int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
||||
int ThreadPoolAdd (ThreadPool*tp,
|
||||
ThreadPoolJob *job,
|
||||
int *jobId);
|
||||
|
||||
/****************************************************************************
|
||||
* Function: ThreadPoolRemove
|
||||
@@ -346,7 +361,8 @@ int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
||||
* 0 on success, nonzero on failure.
|
||||
* INVALID_JOB_ID if job not found.
|
||||
*****************************************************************************/
|
||||
int ThreadPoolRemove(ThreadPool *tp, int jobId, ThreadPoolJob *out);
|
||||
int ThreadPoolRemove(ThreadPool *tp,
|
||||
int jobId, ThreadPoolJob *out);
|
||||
|
||||
|
||||
|
||||
@@ -409,6 +425,7 @@ int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority);
|
||||
*****************************************************************************/
|
||||
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: TPAttrInit
|
||||
*
|
||||
|
66
threadutil/inc/iasnprintf.h
Normal file
66
threadutil/inc/iasnprintf.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* 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 <stdarg.h>
|
||||
|
||||
#define EXPORT
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocates enough memory for the
|
||||
* Formatted string, up to max
|
||||
* specified.
|
||||
* With max set to -1, allocates
|
||||
* as much size as needed.
|
||||
* Memory must be freed using free.
|
||||
*/
|
||||
|
||||
EXPORT int iasnprintf(char **ret,
|
||||
int incr,
|
||||
int max,
|
||||
const char * fmt, ...)
|
||||
#ifndef SPARC_SOLARIS
|
||||
#if (__GNUC__ >= 3)
|
||||
__attribute__((format (__printf__, 4, 5)));
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
EXPORT void iasnprintfFree(char *);
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -31,7 +31,7 @@
|
||||
|
||||
#include "LinkedList.h"
|
||||
#include <sys/param.h>
|
||||
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__)
|
||||
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
|
File diff suppressed because it is too large
Load Diff
153
threadutil/src/iasnprintf.c
Normal file
153
threadutil/src/iasnprintf.c
Normal file
@@ -0,0 +1,153 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 <stdarg.h>
|
||||
#include <assert.h>
|
||||
#include <sys/param.h>
|
||||
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include "iasnprintf.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocates enough memory for the
|
||||
* Formatted string, up to max
|
||||
* specified.
|
||||
* With max set to -1, it allocates as
|
||||
* much size as needed.
|
||||
* Memory must be freed using free.
|
||||
*/
|
||||
|
||||
int
|
||||
iasnprintf( char **ret,
|
||||
int incr,
|
||||
int max,
|
||||
const char *fmt,
|
||||
... )
|
||||
{
|
||||
int size = incr;
|
||||
int retc = 0;
|
||||
va_list ap;
|
||||
char *temp = NULL;
|
||||
|
||||
assert( ret );
|
||||
assert( fmt );
|
||||
( *ret ) = ( char * )malloc( incr );
|
||||
|
||||
if( ( *ret ) == NULL ) return -1;
|
||||
|
||||
while( 1 ) {
|
||||
va_start( ap, fmt );
|
||||
retc = vsnprintf( ( *ret ), size, fmt, ap );
|
||||
va_end( ap );
|
||||
|
||||
if( retc < 0 ) {
|
||||
//size not big enough
|
||||
//and vsnprintf does NOT return the
|
||||
//necessary number of bytes
|
||||
if( ( max != -1 ) && ( size == max ) ) //max reached
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
incr *= 2; //increase increment
|
||||
//increase size and try again
|
||||
if( ( max != -1 ) && ( ( size + incr ) > max ) ) {
|
||||
incr = ( max - size );
|
||||
}
|
||||
|
||||
temp = ( char * )realloc( ( *ret ), size + incr );
|
||||
if( temp == NULL ) {
|
||||
break;
|
||||
}
|
||||
size += incr;
|
||||
( *ret ) = temp;
|
||||
|
||||
} else {
|
||||
if( ( retc + 1 ) > size ) {
|
||||
//size not big enough
|
||||
//and vsnprintf
|
||||
//returns the necessary
|
||||
//number of bytes
|
||||
if( ( max != -1 ) && ( retc + 1 > max ) ) {
|
||||
retc = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
temp = ( char * )realloc( ( *ret ), retc + 1 );
|
||||
if( temp == NULL ) {
|
||||
retc = -1;
|
||||
break;
|
||||
}
|
||||
size = retc + 1;
|
||||
( *ret ) = temp; //size increased try again
|
||||
} else if( ( retc + 1 ) < size ) {
|
||||
//size is bigger than needed
|
||||
//try and reallocate smaller
|
||||
|
||||
temp = ( char * )realloc( ( *ret ), retc + 1 );
|
||||
if( temp != NULL ) {
|
||||
( *ret ) = temp;
|
||||
}
|
||||
break;
|
||||
} else //size is just right, exit
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if( retc < 0 ) {
|
||||
free( ( *ret ) );
|
||||
( *ret ) = NULL;
|
||||
}
|
||||
|
||||
return retc;
|
||||
}
|
||||
|
||||
void
|
||||
iasnprintfFree( char *fChar )
|
||||
{
|
||||
free( fChar );
|
||||
fChar = NULL;
|
||||
}
|
@@ -11,6 +11,10 @@ AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/threadutil/inc \
|
||||
-I$(top_srcdir)/ixml/inc
|
||||
|
||||
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||
|
||||
AM_LDFLAGS = $(PTHREAD_LIBS)
|
||||
|
||||
LDADD = \
|
||||
libupnp.la \
|
||||
$(top_builddir)/threadutil/libthreadutil.la \
|
||||
|
@@ -413,7 +413,7 @@
|
||||
#define UPNP_E_SUBSCRIBE_UNACCEPTED -301
|
||||
/*! @} */
|
||||
|
||||
/** @name UPNP_E_UNSUBSCRIBE_UNACCEPTED [-302]
|
||||
/** @name UPNP_E_UNSUBSCRIBE_UNACCAPTED [-302]
|
||||
* {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED} signifies that an unsubscribe
|
||||
* request was rejected from the remote side.
|
||||
*/
|
||||
|
@@ -9,6 +9,10 @@ AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/threadutil/inc \
|
||||
-I$(top_srcdir)/ixml/inc
|
||||
|
||||
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||
|
||||
AM_LDFLAGS = $(PTHREAD_LIBS)
|
||||
|
||||
LDADD = \
|
||||
$(top_builddir)/upnp/libupnp.la \
|
||||
$(top_builddir)/threadutil/libthreadutil.la \
|
||||
|
@@ -745,7 +745,7 @@ isFileInVirtualDir( IN char *filePath )
|
||||
return TRUE;
|
||||
} else {
|
||||
if( ( strncmp( pCurVirtualDir->dirName, filePath, webDirLen )
|
||||
== 0 ) && ( filePath[webDirLen] == '/' || filePath[webDirLen] == '\0' || filePath[webDirLen] == '?' ) )
|
||||
== 0 ) && ( filePath[webDirLen] == '/' ) )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -555,7 +555,7 @@ parse_hostport( const char *in,
|
||||
int begin_port;
|
||||
int hostport_size = 0;
|
||||
int host_size = 0;
|
||||
#if !defined(WIN32) && !(defined(__OSX__) || defined(__APPLE__))
|
||||
#if !defined(WIN32) && !defined(__OSX__)
|
||||
char temp_hostbyname_buff[BUFFER_SIZE];
|
||||
struct hostent h_buf;
|
||||
#endif
|
||||
@@ -642,7 +642,7 @@ parse_hostport( const char *in,
|
||||
if ( h == NULL ) {
|
||||
errCode = 1;
|
||||
}
|
||||
#elif defined(__OSX__) || defined(__APPLE__)
|
||||
#elif defined(__OSX__)
|
||||
h = gethostbyname(temp_host_name);
|
||||
if ( h == NULL ) {
|
||||
errCode = 1;
|
||||
|
@@ -126,18 +126,18 @@ int web_server_set_alias( IN const char* alias_name,
|
||||
int web_server_set_root_dir( IN const char* root_dir );
|
||||
|
||||
/************************************************************************
|
||||
* Function: web_server_callback
|
||||
*
|
||||
* Parameters:
|
||||
* IN http_parser_t *parser,
|
||||
* INOUT http_message_t* req,
|
||||
* IN SOCKINFO *info
|
||||
*
|
||||
* Description: main entry point into web server;
|
||||
* handles HTTP GET and HEAD requests
|
||||
*
|
||||
* Returns:
|
||||
* void
|
||||
* Function: web_server_callback *
|
||||
* *
|
||||
* Parameters: *
|
||||
* IN http_parser_t *parser, *
|
||||
* INOUT http_message_t* req, *
|
||||
* IN SOCKINFO *info *
|
||||
* *
|
||||
* Description: main entry point into web server; *
|
||||
* handles HTTP GET and HEAD requests *
|
||||
* *
|
||||
* Returns: *
|
||||
* void *
|
||||
************************************************************************/
|
||||
void web_server_callback( IN http_parser_t *parser, IN http_message_t* req, INOUT SOCKINFO *info );
|
||||
|
||||
@@ -148,4 +148,3 @@ void web_server_callback( IN http_parser_t *parser, IN http_message_t* req, INOU
|
||||
|
||||
|
||||
#endif // GENLIB_NET_HTTP_WEBSERVER_H
|
||||
|
||||
|
@@ -870,7 +870,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
UpnpPrintf( UPNP_CRITICAL,
|
||||
SSDP, __FILE__, __LINE__,
|
||||
"Error in socket operation !!!\n" );
|
||||
|
||||
return UPNP_E_OUTOF_SOCKET;
|
||||
}
|
||||
setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
||||
@@ -885,7 +884,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
"Error in socket operation !!!\n" );
|
||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||
|
||||
return UPNP_E_OUTOF_SOCKET;
|
||||
}
|
||||
|
||||
@@ -899,11 +897,10 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||
shutdown( ssdpSock, SD_BOTH );
|
||||
UpnpCloseSocket( ssdpSock );
|
||||
|
||||
return UPNP_E_SOCKET_ERROR;
|
||||
}
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__)
|
||||
#ifdef __FreeBSD__
|
||||
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT,
|
||||
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
|
||||
UpnpPrintf( UPNP_CRITICAL,
|
||||
@@ -913,7 +910,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||
shutdown( ssdpSock, SD_BOTH );
|
||||
UpnpCloseSocket( ssdpSock );
|
||||
|
||||
return UPNP_E_SOCKET_ERROR;
|
||||
}
|
||||
#endif /* __FreeBSD__ */
|
||||
@@ -932,7 +928,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
UpnpCloseSocket( ssdpSock );
|
||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||
|
||||
return UPNP_E_SOCKET_BIND;
|
||||
}
|
||||
|
||||
@@ -948,7 +943,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||
UpnpCloseSocket( ssdpSock );
|
||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||
|
||||
return UPNP_E_SOCKET_ERROR;
|
||||
}
|
||||
|
||||
@@ -974,13 +968,11 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||
UpnpCloseSocket( ssdpSock );
|
||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||
|
||||
return UPNP_E_NETWORK_ERROR;
|
||||
}
|
||||
|
||||
CLIENTONLY( out->ssdpReqSock = ssdpReqSock; )
|
||||
out->ssdpSock = ssdpSock;
|
||||
|
||||
return UPNP_E_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user