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
|
Version 1.6.2
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
@@ -425,7 +358,7 @@ Version 1.4.2
|
|||||||
2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
|
|
||||||
* SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2
|
* 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
|
Summary: This patch hopefully fixes the remaining types and related
|
||||||
code to enable files >= 2 GiB to be streamed. Jonathan claims to have
|
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.
|
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
|
- Arno Willig
|
||||||
- Bob Ciora
|
- Bob Ciora
|
||||||
- Chaos
|
- Chaos
|
||||||
- Chris Pickel
|
|
||||||
- Craig Nelson
|
- Craig Nelson
|
||||||
- David Maass
|
- David Maass
|
||||||
- Emil Ljungdahl
|
- Emil Ljungdahl
|
||||||
@@ -21,25 +20,20 @@ exempt of errors.
|
|||||||
- Fabrice Fontaine
|
- Fabrice Fontaine
|
||||||
- Fredrik Svensson
|
- Fredrik Svensson
|
||||||
- Glen Masgai
|
- Glen Masgai
|
||||||
- Hartmut Holzgraefe - hholzgra
|
|
||||||
- Ingo Hofmann
|
|
||||||
- Jiri Zouhar
|
- Jiri Zouhar
|
||||||
- John Dennis
|
- John Dennis
|
||||||
- Jonathan Casiot (no_dice)
|
- Jonathan (no_dice)
|
||||||
- Josh Carroll
|
|
||||||
- Keith Brindley
|
- Keith Brindley
|
||||||
- Leuk_He
|
- Leuk_He
|
||||||
- Loigu
|
- Loigu
|
||||||
- Luke Kim
|
- Luke Kim
|
||||||
- Marcelo Roberto Jimenez (mroberto)
|
- Marcelo Roberto Jimenez (mroberto)
|
||||||
- Markus Strobl
|
- Markus Strobl
|
||||||
- Nektarios K. Papadopoulos (npapadop)
|
- Nektarios K. Papadopoulos
|
||||||
- Oskar Liljeblad
|
- Oskar Liljeblad
|
||||||
- Michael (oxygenic)
|
- Michael (Oxy)
|
||||||
- Paul Vixie
|
- Paul Vixie
|
||||||
- Peter Hartley
|
|
||||||
- Rene Hexel
|
- Rene Hexel
|
||||||
- Robert Gingher (robsbox)
|
|
||||||
- Siva Chandran
|
- Siva Chandran
|
||||||
- Stéphane Corthésy
|
- Stéphane Corthésy
|
||||||
- Steve Bresson
|
- Steve Bresson
|
||||||
|
263
configure.ac
263
configure.ac
@@ -9,133 +9,108 @@
|
|||||||
|
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
|
|
||||||
AC_INIT([libupnp], [1.6.4], [mroberto@users.sourceforge.net])
|
AC_INIT([libupnp], [1.6.2], [mroberto@users.sourceforge.net])
|
||||||
dnl ############################################################################
|
###############################################################################
|
||||||
dnl # *Independently* of the above libupnp package version, the libtool version
|
# *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:
|
# 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),
|
# "current:revision:age" (this is NOT the same as the package version), where:
|
||||||
dnl # where:
|
# - library code modified: revision++
|
||||||
dnl # - library code modified: revision++
|
# - interfaces changed/added/removed: current++ and revision=0
|
||||||
dnl # - interfaces changed/added/removed: current++ and revision=0
|
# - interfaces added: age++
|
||||||
dnl # - interfaces added: age++
|
# - interfaces removed: age=0
|
||||||
dnl # - interfaces removed: age=0
|
# *please update only once, before a formal release, not for each change*
|
||||||
dnl # *please update only once, before a formal release, not for each change*
|
#
|
||||||
dnl #
|
###############################################################################
|
||||||
dnl ############################################################################
|
# Release 1.4.1:
|
||||||
dnl # Release 1.4.1:
|
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
#
|
||||||
dnl #
|
###############################################################################
|
||||||
dnl ############################################################################
|
# Release 1.4.6:
|
||||||
dnl # Release 1.4.6:
|
# "current:revision:age"
|
||||||
dnl # "current:revision:age"
|
#
|
||||||
dnl #
|
# - Code has changed in ixml
|
||||||
dnl # - Code has changed in ixml
|
# revision: 2 -> 3
|
||||||
dnl # revision: 2 -> 3
|
# - Code has changed in threadutil
|
||||||
dnl # - Code has changed in threadutil
|
# revision: 2 -> 3
|
||||||
dnl # revision: 2 -> 3
|
# - Interface added in threadutil
|
||||||
dnl # - Interface added in threadutil
|
# current: 2 -> 3
|
||||||
dnl # current: 2 -> 3
|
# revisiion: 3 -> 0
|
||||||
dnl # revisiion: 3 -> 0
|
# age: 0 -> 1
|
||||||
dnl # age: 0 -> 1
|
# - Code has changed in upnp
|
||||||
dnl # - Code has changed in upnp
|
# revision: 2 -> 3
|
||||||
dnl # revision: 2 -> 3
|
#
|
||||||
dnl #
|
#AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
#AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
||||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
#AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
#
|
||||||
dnl #
|
###############################################################################
|
||||||
dnl ############################################################################
|
# Release 1.6.0:
|
||||||
dnl # Release 1.6.0:
|
# "current:revision:age"
|
||||||
dnl # "current:revision:age"
|
#
|
||||||
dnl #
|
# - Code has changed in ixml
|
||||||
dnl # - Code has changed in ixml
|
# revision: 3 -> 4
|
||||||
dnl # revision: 3 -> 4
|
# - Code has changed in threadutil
|
||||||
dnl # - Code has changed in threadutil
|
# revision: 0 -> 1
|
||||||
dnl # revision: 0 -> 1
|
# - Code has changed in upnp
|
||||||
dnl # - Code has changed in upnp
|
# revision: 3 -> 4
|
||||||
dnl # revision: 3 -> 4
|
# - Interface changed in upnp
|
||||||
dnl # - Interface changed in upnp
|
# current: 2 -> 3
|
||||||
dnl # current: 2 -> 3
|
# revision: 4 -> 0
|
||||||
dnl # revision: 4 -> 0
|
# - Interface removed in upnp
|
||||||
dnl # - Interface removed in upnp
|
# age: 0 -> 0
|
||||||
dnl # age: 0 -> 0
|
#
|
||||||
dnl #
|
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
#AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1])
|
||||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1])
|
#AC_SUBST([LT_VERSION_UPNP], [3:0:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:0:0])
|
#
|
||||||
dnl #
|
###############################################################################
|
||||||
dnl ############################################################################
|
# Release 1.6.1:
|
||||||
dnl # Release 1.6.1:
|
# "current:revision:age"
|
||||||
dnl # "current:revision:age"
|
#
|
||||||
dnl #
|
# - Code has changed in threadutil
|
||||||
dnl # - Code has changed in threadutil
|
# revision: 1 -> 2
|
||||||
dnl # revision: 1 -> 2
|
# - Interface added in threadutil
|
||||||
dnl # - Interface added in threadutil
|
# current: 3 -> 4
|
||||||
dnl # current: 3 -> 4
|
# revision: 2 -> 0
|
||||||
dnl # revision: 2 -> 0
|
# - Interface added in threadutil
|
||||||
dnl # - Interface added in threadutil
|
# age: 1 -> 2
|
||||||
dnl # age: 1 -> 2
|
# - Code has changed in upnp
|
||||||
dnl # - Code has changed in upnp
|
# revision: 0 -> 1
|
||||||
dnl # revision: 0 -> 1
|
#
|
||||||
dnl #
|
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
#AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
#AC_SUBST([LT_VERSION_UPNP], [3:1:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_UPNP], [3:1:0])
|
#
|
||||||
dnl #
|
###############################################################################
|
||||||
dnl ############################################################################
|
# Release 1.6.2:
|
||||||
dnl # Release 1.6.2:
|
# "current:revision:age"
|
||||||
dnl # "current:revision:age"
|
#
|
||||||
dnl #
|
# - Code has changed in upnp
|
||||||
dnl # - Code has changed in upnp
|
# revision: 1 -> 2
|
||||||
dnl # revision: 1 -> 2
|
#
|
||||||
dnl #
|
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||||
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
#AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||||
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
#AC_SUBST([LT_VERSION_UPNP], [3:2:0])
|
||||||
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_SUBST([LT_VERSION_IXML], [2:4:0])
|
AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
||||||
AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
|
AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
||||||
AC_SUBST([LT_VERSION_UPNP], [3:3:0])
|
AC_SUBST([LT_VERSION_UPNP], [3:2:0])
|
||||||
dnl ############################################################################
|
###############################################################################
|
||||||
dnl # Repeating the algorithm to place it closer to the modificatin place:
|
# Repeating the algorithm so that it is closer to the modificatin place:
|
||||||
dnl # - library code modified: revision++
|
# - library code modified: revision++
|
||||||
dnl # - interfaces changed/added/removed: current++ and revision=0
|
# - interfaces changed/added/removed: current++ and revision=0
|
||||||
dnl # - interfaces added: age++
|
# - interfaces added: age++
|
||||||
dnl # - interfaces removed: age=0
|
# - interfaces removed: age=0
|
||||||
dnl # *please update only once, before a formal release, not for each change*
|
# *please update only once, before a formal release, not for each change*
|
||||||
dnl ############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR(config.aux)
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR(m4)
|
||||||
AC_CONFIG_SRCDIR([upnp/inc/upnp.h])
|
AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
|
||||||
|
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
|
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/\..*//' `
|
upnpmaj=`echo "$PACKAGE_VERSION" | sed 's/\..*//' `
|
||||||
upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `]
|
upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `]
|
||||||
upnppatch=[`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_MAJOR], $upnpmaj, [see upnpconfig.h])
|
||||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h])
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h])
|
||||||
AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h])
|
AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h])
|
||||||
@@ -187,6 +163,7 @@ fi
|
|||||||
#
|
#
|
||||||
# Check for libupnp subsets
|
# Check for libupnp subsets
|
||||||
#
|
#
|
||||||
|
|
||||||
RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)])
|
RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)])
|
||||||
if test "x$enable_client" = xyes ; then
|
if test "x$enable_client" = xyes ; then
|
||||||
AC_DEFINE(UPNP_HAVE_CLIENT, 1, [see upnpconfig.h])
|
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])
|
RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code])
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# doc installation
|
# doc installation
|
||||||
# autoconf >= 2.60 already defines ${docdir}, but we will not use its
|
# autoconf >= 2.60 already defines ${docdir}, but we will not use its
|
||||||
# default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}.
|
# default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}.
|
||||||
# That would give us ${datarootdir}/doc/libupnp, and we want the package
|
# That would give us ${datarootdir}/doc/libupnp, and we want the package
|
||||||
# version on that.
|
# version on that.
|
||||||
#
|
|
||||||
docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"
|
docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}"
|
||||||
AC_MSG_CHECKING([for documentation directory])
|
AC_MSG_CHECKING([for documentation directory])
|
||||||
AC_ARG_WITH(
|
AC_ARG_WITH(
|
||||||
@@ -241,9 +216,7 @@ AS_HELP_STRING(
|
|||||||
[],
|
[],
|
||||||
[with_documentation=no])
|
[with_documentation=no])
|
||||||
|
|
||||||
#
|
|
||||||
# If something has been entered after an equal sign, assume it is the directory
|
# 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
|
if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then
|
||||||
docdir="$with_documentation"
|
docdir="$with_documentation"
|
||||||
fi
|
fi
|
||||||
@@ -329,6 +302,7 @@ AC_CHECK_HEADERS(
|
|||||||
# Checks for typedefs, structures, and compiler characteristics
|
# Checks for typedefs, structures, and compiler characteristics
|
||||||
#
|
#
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
|
AC_TYPE_SIZE_T
|
||||||
TYPE_SOCKLEN_T
|
TYPE_SOCKLEN_T
|
||||||
|
|
||||||
|
|
||||||
@@ -343,40 +317,9 @@ AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)])
|
|||||||
#
|
#
|
||||||
# Checks for POSIX Threads
|
# Checks for POSIX Threads
|
||||||
#
|
#
|
||||||
echo "--------------------------- pthread stuff -------------------------------------"
|
|
||||||
ACX_PTHREAD(
|
ACX_PTHREAD(
|
||||||
[],
|
[],
|
||||||
[AC_MSG_ERROR([POSIX threads are required to build this program])])
|
[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([
|
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_SOCKET_ERROR-208.html \
|
||||||
./html/upnp/UPNP_E_CANCELED-210.html \
|
./html/upnp/UPNP_E_CANCELED-210.html \
|
||||||
./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.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_NOTIFY_UNACCEPTED-303.html \
|
||||||
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
|
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
|
||||||
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.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_SOCKET_ERROR-208.html \
|
||||||
./html/upnp/UPNP_E_CANCELED-210.html \
|
./html/upnp/UPNP_E_CANCELED-210.html \
|
||||||
./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.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_NOTIFY_UNACCEPTED-303.html \
|
||||||
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
|
./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \
|
||||||
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \
|
./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \
|
||||||
|
@@ -38,7 +38,11 @@
|
|||||||
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
|
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||||
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||||
|
|
||||||
#define MEMBUF_DEF_SIZE_INC 20
|
#ifndef WIN32
|
||||||
|
#define UPNP_INLINE inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MEMBUF_DEF_SIZE_INC 20
|
||||||
|
|
||||||
|
|
||||||
typedef struct // ixml_membuf
|
typedef struct // ixml_membuf
|
||||||
|
@@ -501,22 +501,17 @@ Parser_init( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*================================================================
|
/*================================================================
|
||||||
* Parser_isValidEndElement
|
* Parser_isValidEndElement
|
||||||
* check if a new node->nodeName matches top of element stack.
|
* check if a new node->nodeName matches top of element stack.
|
||||||
* Internal to parser only.
|
* Internal to parser only.
|
||||||
*=================================================================*/
|
*
|
||||||
|
*=================================================================*/
|
||||||
static int
|
static int
|
||||||
Parser_isValidEndElement(
|
Parser_isValidEndElement( IN Parser * xmlParser,
|
||||||
IN Parser * xmlParser,
|
IN IXML_Node * newNode )
|
||||||
IN IXML_Node * newNode )
|
|
||||||
{
|
{
|
||||||
assert( xmlParser );
|
return ( strcmp( xmlParser->pCurElement->element, newNode->nodeName )
|
||||||
assert( xmlParser->pCurElement );
|
== 0 );
|
||||||
assert( xmlParser->pCurElement->element );
|
|
||||||
assert( newNode );
|
|
||||||
assert( newNode->nodeName );
|
|
||||||
|
|
||||||
return strcmp( xmlParser->pCurElement->element, newNode->nodeName ) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===============================================================
|
/*===============================================================
|
||||||
@@ -926,8 +921,6 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
|||||||
int rc = IXML_SUCCESS;
|
int rc = IXML_SUCCESS;
|
||||||
IXML_CDATASection *cdataSecNode = NULL;
|
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 );
|
ixmlNode_init( &newNode );
|
||||||
|
|
||||||
rc = ixmlDocument_createDocumentEx( &gRootDoc );
|
rc = ixmlDocument_createDocumentEx( &gRootDoc );
|
||||||
@@ -943,9 +936,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
while( bETag == FALSE ) {
|
while( bETag == FALSE ) {
|
||||||
// clear the newNode contents. Redundant on the first iteration,
|
// clear the newNode contents
|
||||||
// but nonetheless, necessary due to the possible calls to
|
|
||||||
// ErrorHandler above. Currently, this is just a memset to zero.
|
|
||||||
ixmlNode_init( &newNode );
|
ixmlNode_init( &newNode );
|
||||||
|
|
||||||
if( Parser_getNextNode( xmlParser, &newNode, &bETag ) ==
|
if( Parser_getNextNode( xmlParser, &newNode, &bETag ) ==
|
||||||
@@ -1039,7 +1030,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc,
|
|||||||
Parser_free( xmlParser );
|
Parser_free( xmlParser );
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
ErrorHandler:
|
ErrorHandler:
|
||||||
Parser_freeNodeContent( &newNode );
|
Parser_freeNodeContent( &newNode );
|
||||||
ixmlDocument_free( gRootDoc );
|
ixmlDocument_free( gRootDoc );
|
||||||
Parser_free( xmlParser );
|
Parser_free( xmlParser );
|
||||||
@@ -2506,4 +2497,3 @@ Parser_getNextNode( IN Parser * xmlParser,
|
|||||||
return IXML_SYNTAX_ERR;
|
return IXML_SYNTAX_ERR;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Version: 1.6.4
|
Version: 1.6.2
|
||||||
Summary: Universal Plug and Play (UPnP) SDK
|
Summary: Universal Plug and Play (UPnP) SDK
|
||||||
Name: libupnp
|
Name: libupnp
|
||||||
Release: 1%{?dist}
|
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
|
test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl
|
||||||
&& enable_[]Name=[$2]
|
&& enable_[]Name=[$2]
|
||||||
AC_MSG_RESULT($enable_[]Name)
|
AC_MSG_RESULT($enable_[]Name)dnl
|
||||||
AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes)
|
AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes)
|
||||||
dnl
|
dnl
|
||||||
m4_popdef([NAME])dnl
|
m4_popdef([NAME])dnl
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc
|
AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc
|
||||||
|
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||||
|
|
||||||
if ENABLE_DEBUG
|
if ENABLE_DEBUG
|
||||||
AM_CPPFLAGS += -DDEBUG -DSTATS
|
AM_CPPFLAGS += -DDEBUG -DSTATS
|
||||||
@@ -20,11 +21,12 @@ libthreadutil_la_LDFLAGS = -version-info $(LT_VERSION_THREADUTIL)
|
|||||||
|
|
||||||
libthreadutil_la_SOURCES = \
|
libthreadutil_la_SOURCES = \
|
||||||
src/FreeList.c src/LinkedList.c \
|
src/FreeList.c src/LinkedList.c \
|
||||||
src/ThreadPool.c src/TimerThread.c
|
src/ThreadPool.c src/TimerThread.c \
|
||||||
|
src/iasnprintf.c
|
||||||
|
|
||||||
upnpincludedir = $(includedir)/upnp
|
upnpincludedir = $(includedir)/upnp
|
||||||
upnpinclude_HEADERS = \
|
upnpinclude_HEADERS = \
|
||||||
inc/FreeList.h inc/LinkedList.h \
|
inc/FreeList.h inc/LinkedList.h \
|
||||||
inc/ThreadPool.h inc/TimerThread.h \
|
inc/ThreadPool.h inc/TimerThread.h \
|
||||||
inc/ithread.h
|
inc/iasnprintf.h inc/ithread.h
|
||||||
|
|
||||||
|
@@ -32,12 +32,6 @@
|
|||||||
#ifndef THREADPOOL_H
|
#ifndef THREADPOOL_H
|
||||||
#define THREADPOOL_H
|
#define THREADPOOL_H
|
||||||
|
|
||||||
#ifdef UPNP_USE_MSVCPP
|
|
||||||
#define UPNP_INLINE
|
|
||||||
#else
|
|
||||||
#define UPNP_INLINE inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -70,23 +64,32 @@ typedef enum priority {LOW_PRIORITY,
|
|||||||
#define DEFAULT_FREE_ROUTINE NULL /* default free routine used TPJobInit */
|
#define DEFAULT_FREE_ROUTINE NULL /* default free routine used TPJobInit */
|
||||||
#define DEFAULT_MAX_JOBS_TOTAL 100 /* default max jobs used TPAttrInit */
|
#define DEFAULT_MAX_JOBS_TOTAL 100 /* default max jobs used TPAttrInit */
|
||||||
|
|
||||||
|
#define STATS 1 /* always include stats because code change is minimal */
|
||||||
|
|
||||||
|
|
||||||
/* Statistics */
|
/* Statistics */
|
||||||
/* always include stats because code change is minimal */
|
#ifdef WIN32 /* TODO: check why STATSONLY fails during compilation */
|
||||||
#define STATS 1
|
#undef STATS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef STATS
|
||||||
|
#define STATSONLY(x) x
|
||||||
|
#else
|
||||||
|
#define STATSONLY(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "LinkedList.h"
|
#include "LinkedList.h"
|
||||||
#include <sys/time.h> /* for gettimeofday() */
|
#include <sys/timeb.h>
|
||||||
#include "FreeList.h"
|
#include "FreeList.h"
|
||||||
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <sys/timeb.h>
|
||||||
#define EXPORT
|
#define EXPORT
|
||||||
|
|
||||||
typedef int PolicyType;
|
typedef int PolicyType;
|
||||||
#define DEFAULT_POLICY SCHED_OTHER
|
#define DEFAULT_POLICY SCHED_OTHER
|
||||||
#define DEFAULT_SCHED_PARAM 0 /* default priority */
|
#define DEFAULT_SCHED_PARAM 0 /* default priority */
|
||||||
@@ -108,28 +111,26 @@ typedef void (*free_routine)(void *arg);
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct THREADPOOLATTR
|
typedef struct THREADPOOLATTR
|
||||||
{
|
{
|
||||||
/* minThreads, ThreadPool will always maintain at least this many threads */
|
int minThreads; /* minThreads, ThreadPool will always maintain at least
|
||||||
int minThreads;
|
this many threads */
|
||||||
|
|
||||||
/* maxThreads, ThreadPool will never have more than this number of threads */
|
int maxThreads; /* maxThreads, ThreadPool will never have more than this
|
||||||
int maxThreads;
|
number of threads */
|
||||||
|
|
||||||
/* maxIdleTime (in milliseconds) this is the maximum time a thread will
|
int maxIdleTime; /* maxIdleTime (in milliseconds)
|
||||||
* remain idle before dying */
|
this is the maximum time a thread will remain idle
|
||||||
int maxIdleTime;
|
before dying */
|
||||||
|
|
||||||
/* jobs per thread to maintain */
|
int jobsPerThread; /* jobs per thread to maintain */
|
||||||
int jobsPerThread;
|
|
||||||
|
|
||||||
/* maximum number of jobs that can be queued totally. */
|
int maxJobsTotal; /* maximum number of jobs that can be queued totally. */
|
||||||
int maxJobsTotal;
|
|
||||||
|
|
||||||
/* the time a low priority or med priority job waits before getting bumped
|
int starvationTime; /* the time a low priority or med priority
|
||||||
* up a priority (in milliseconds) */
|
job waits before getting bumped
|
||||||
int starvationTime;
|
up a priority (in milliseconds) */
|
||||||
|
|
||||||
|
PolicyType schedPolicy; /* scheduling policy to use */
|
||||||
|
|
||||||
/* scheduling policy to use */
|
|
||||||
PolicyType schedPolicy;
|
|
||||||
} ThreadPoolAttr;
|
} ThreadPoolAttr;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -140,12 +141,12 @@ typedef struct THREADPOOLATTR
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
typedef struct THREADPOOLJOB
|
typedef struct THREADPOOLJOB
|
||||||
{
|
{
|
||||||
start_routine func;
|
start_routine func;
|
||||||
void *arg;
|
void *arg;
|
||||||
free_routine free_func;
|
free_routine free_func;
|
||||||
struct timeval requestTime;
|
struct timeb requestTime;
|
||||||
int priority;
|
int priority;
|
||||||
int jobId;
|
int jobId;
|
||||||
} ThreadPoolJob;
|
} ThreadPoolJob;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -155,28 +156,32 @@ typedef struct THREADPOOLJOB
|
|||||||
* Structure to hold statistics
|
* Structure to hold statistics
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef STATS
|
||||||
|
|
||||||
typedef struct TPOOLSTATS
|
typedef struct TPOOLSTATS
|
||||||
{
|
{
|
||||||
double totalTimeHQ;
|
double totalTimeHQ;
|
||||||
int totalJobsHQ;
|
int totalJobsHQ;
|
||||||
double avgWaitHQ;
|
double avgWaitHQ;
|
||||||
double totalTimeMQ;
|
double totalTimeMQ;
|
||||||
int totalJobsMQ;
|
int totalJobsMQ;
|
||||||
double avgWaitMQ;
|
double avgWaitMQ;
|
||||||
double totalTimeLQ;
|
double totalTimeLQ;
|
||||||
int totalJobsLQ;
|
int totalJobsLQ;
|
||||||
double avgWaitLQ;
|
double avgWaitLQ;
|
||||||
double totalWorkTime;
|
double totalWorkTime;
|
||||||
double totalIdleTime;
|
double totalIdleTime;
|
||||||
int workerThreads;
|
int workerThreads;
|
||||||
int idleThreads;
|
int idleThreads;
|
||||||
int persistentThreads;
|
int persistentThreads;
|
||||||
int totalThreads;
|
int totalThreads;
|
||||||
int maxThreads;
|
int maxThreads;
|
||||||
int currentJobsHQ;
|
int currentJobsHQ;
|
||||||
int currentJobsLQ;
|
int currentJobsLQ;
|
||||||
int currentJobsMQ;
|
int currentJobsMQ;
|
||||||
} ThreadPoolStats;
|
}ThreadPoolStats;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -201,24 +206,27 @@ typedef struct TPOOLSTATS
|
|||||||
|
|
||||||
typedef struct THREADPOOL
|
typedef struct THREADPOOL
|
||||||
{
|
{
|
||||||
ithread_mutex_t mutex; /* mutex to protect job qs */
|
ithread_mutex_t mutex; /* mutex to protect job qs */
|
||||||
ithread_cond_t condition; /* condition variable to signal Q */
|
ithread_cond_t condition; /* condition variable to signal Q */
|
||||||
ithread_cond_t start_and_shutdown; /* condition variable for start
|
ithread_cond_t start_and_shutdown; /* condition variable for start
|
||||||
and stop */
|
and stop */
|
||||||
int lastJobId; /* ids for jobs */
|
int lastJobId; /* ids for jobs */
|
||||||
int shutdown; /* whether or not we are shutting down */
|
int shutdown; /* whether or not we are shutting down */
|
||||||
int totalThreads; /* total number of threads */
|
int totalThreads; /* total number of threads */
|
||||||
int persistentThreads; /* number of persistent threads */
|
int persistentThreads; /* number of persistent threads */
|
||||||
FreeList jobFreeList; /* free list of jobs */
|
FreeList jobFreeList; /* free list of jobs */
|
||||||
LinkedList lowJobQ; /* low priority job Q */
|
LinkedList lowJobQ; /* low priority job Q */
|
||||||
LinkedList medJobQ; /* med priority job Q */
|
LinkedList medJobQ; /* med priority job Q */
|
||||||
LinkedList highJobQ; /* high priority job Q */
|
LinkedList highJobQ; /* high priority job Q */
|
||||||
ThreadPoolJob *persistentJob; /* persistent job */
|
ThreadPoolJob *persistentJob; /* persistent job */
|
||||||
|
|
||||||
ThreadPoolAttr attr; /* thread pool attributes */
|
ThreadPoolAttr attr; /* thread pool attributes */
|
||||||
|
|
||||||
/* statistics */
|
#ifdef STATS
|
||||||
ThreadPoolStats stats;
|
/* statistics */
|
||||||
|
ThreadPoolStats stats;
|
||||||
|
#endif
|
||||||
|
|
||||||
} ThreadPool;
|
} ThreadPool;
|
||||||
|
|
||||||
|
|
||||||
@@ -259,7 +267,8 @@ typedef struct THREADPOOL
|
|||||||
* INVALID_POLICY if schedPolicy can't be set
|
* INVALID_POLICY if schedPolicy can't be set
|
||||||
* EMAXTHREADS if minimum threads is greater than maximum threads
|
* EMAXTHREADS if minimum threads is greater than maximum threads
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr);
|
int ThreadPoolInit(ThreadPool *tp,
|
||||||
|
ThreadPoolAttr *attr);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolAddPersistent
|
* Function: ThreadPoolAddPersistent
|
||||||
@@ -281,7 +290,9 @@ int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr);
|
|||||||
* EOUTOFMEM not enough memory to add job.
|
* EOUTOFMEM not enough memory to add job.
|
||||||
* EMAXTHREADS not enough threads to add persistent 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
|
* Function: ThreadPoolGetAttr
|
||||||
@@ -296,7 +307,8 @@ int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
|||||||
* 0 on success, nonzero on failure
|
* 0 on success, nonzero on failure
|
||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out);
|
int ThreadPoolGetAttr(ThreadPool *tp,
|
||||||
|
ThreadPoolAttr *out);
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolSetAttr
|
* Function: ThreadPoolSetAttr
|
||||||
*
|
*
|
||||||
@@ -310,7 +322,8 @@ int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out);
|
|||||||
* 0 on success, nonzero on failure
|
* 0 on success, nonzero on failure
|
||||||
* Returns INVALID_POLICY if policy can not be set.
|
* Returns INVALID_POLICY if policy can not be set.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr);
|
int ThreadPoolSetAttr(ThreadPool *tp,
|
||||||
|
ThreadPoolAttr *attr);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolAdd
|
* Function: ThreadPoolAdd
|
||||||
@@ -329,7 +342,9 @@ int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr);
|
|||||||
* 0 on success, nonzero on failure
|
* 0 on success, nonzero on failure
|
||||||
* EOUTOFMEM if not enough memory to add job.
|
* 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
|
* Function: ThreadPoolRemove
|
||||||
@@ -346,7 +361,8 @@ int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId);
|
|||||||
* 0 on success, nonzero on failure.
|
* 0 on success, nonzero on failure.
|
||||||
* INVALID_JOB_ID if job not found.
|
* 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);
|
int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: TPAttrInit
|
* 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 "LinkedList.h"
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__)
|
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <malloc.h>
|
#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)/threadutil/inc \
|
||||||
-I$(top_srcdir)/ixml/inc
|
-I$(top_srcdir)/ixml/inc
|
||||||
|
|
||||||
|
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||||
|
|
||||||
|
AM_LDFLAGS = $(PTHREAD_LIBS)
|
||||||
|
|
||||||
LDADD = \
|
LDADD = \
|
||||||
libupnp.la \
|
libupnp.la \
|
||||||
$(top_builddir)/threadutil/libthreadutil.la \
|
$(top_builddir)/threadutil/libthreadutil.la \
|
||||||
|
@@ -413,7 +413,7 @@
|
|||||||
#define UPNP_E_SUBSCRIBE_UNACCEPTED -301
|
#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
|
* {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED} signifies that an unsubscribe
|
||||||
* request was rejected from the remote side.
|
* request was rejected from the remote side.
|
||||||
*/
|
*/
|
||||||
|
@@ -9,6 +9,10 @@ AM_CPPFLAGS = \
|
|||||||
-I$(top_srcdir)/threadutil/inc \
|
-I$(top_srcdir)/threadutil/inc \
|
||||||
-I$(top_srcdir)/ixml/inc
|
-I$(top_srcdir)/ixml/inc
|
||||||
|
|
||||||
|
AM_CFLAGS = $(PTHREAD_CFLAGS)
|
||||||
|
|
||||||
|
AM_LDFLAGS = $(PTHREAD_LIBS)
|
||||||
|
|
||||||
LDADD = \
|
LDADD = \
|
||||||
$(top_builddir)/upnp/libupnp.la \
|
$(top_builddir)/upnp/libupnp.la \
|
||||||
$(top_builddir)/threadutil/libthreadutil.la \
|
$(top_builddir)/threadutil/libthreadutil.la \
|
||||||
|
@@ -745,7 +745,7 @@ isFileInVirtualDir( IN char *filePath )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
if( ( strncmp( pCurVirtualDir->dirName, filePath, webDirLen )
|
if( ( strncmp( pCurVirtualDir->dirName, filePath, webDirLen )
|
||||||
== 0 ) && ( filePath[webDirLen] == '/' || filePath[webDirLen] == '\0' || filePath[webDirLen] == '?' ) )
|
== 0 ) && ( filePath[webDirLen] == '/' ) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -555,7 +555,7 @@ parse_hostport( const char *in,
|
|||||||
int begin_port;
|
int begin_port;
|
||||||
int hostport_size = 0;
|
int hostport_size = 0;
|
||||||
int host_size = 0;
|
int host_size = 0;
|
||||||
#if !defined(WIN32) && !(defined(__OSX__) || defined(__APPLE__))
|
#if !defined(WIN32) && !defined(__OSX__)
|
||||||
char temp_hostbyname_buff[BUFFER_SIZE];
|
char temp_hostbyname_buff[BUFFER_SIZE];
|
||||||
struct hostent h_buf;
|
struct hostent h_buf;
|
||||||
#endif
|
#endif
|
||||||
@@ -642,7 +642,7 @@ parse_hostport( const char *in,
|
|||||||
if ( h == NULL ) {
|
if ( h == NULL ) {
|
||||||
errCode = 1;
|
errCode = 1;
|
||||||
}
|
}
|
||||||
#elif defined(__OSX__) || defined(__APPLE__)
|
#elif defined(__OSX__)
|
||||||
h = gethostbyname(temp_host_name);
|
h = gethostbyname(temp_host_name);
|
||||||
if ( h == NULL ) {
|
if ( h == NULL ) {
|
||||||
errCode = 1;
|
errCode = 1;
|
||||||
|
@@ -56,88 +56,88 @@ struct SendInstruction
|
|||||||
};
|
};
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_init
|
* Function: web_server_init
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Description: Initilialize the different documents. Initialize the
|
* Description: Initilialize the different documents. Initialize the
|
||||||
* memory for root directory for web server. Call to initialize global
|
* memory for root directory for web server. Call to initialize global
|
||||||
* XML document. Sets bWebServerState to WEB_SERVER_ENABLED
|
* XML document. Sets bWebServerState to WEB_SERVER_ENABLED
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 - OK
|
* 0 - OK
|
||||||
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int web_server_init( void );
|
int web_server_init( void );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_destroy
|
* Function: web_server_destroy
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* none
|
* none
|
||||||
*
|
*
|
||||||
* Description: Release memory allocated for the global web server root
|
* Description: Release memory allocated for the global web server root
|
||||||
* directory and the global XML document
|
* directory and the global XML document
|
||||||
* Resets the flag bWebServerState to WEB_SERVER_DISABLED
|
* Resets the flag bWebServerState to WEB_SERVER_DISABLED
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* void
|
* void
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
void web_server_destroy( void );
|
void web_server_destroy( void );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_set_alias
|
* Function: web_server_set_alias
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* alias_name: webserver name of alias; created by caller and freed by
|
* alias_name: webserver name of alias; created by caller and freed by
|
||||||
* caller (doesn't even have to be malloc()d .)
|
* caller (doesn't even have to be malloc()d .)
|
||||||
* alias_content: the xml doc; this is allocated by the caller; and
|
* alias_content: the xml doc; this is allocated by the caller; and
|
||||||
* freed by the web server
|
* freed by the web server
|
||||||
* alias_content_length: length of alias body in bytes
|
* alias_content_length: length of alias body in bytes
|
||||||
* last_modified: time when the contents of alias were last
|
* last_modified: time when the contents of alias were last
|
||||||
* changed (local time)
|
* changed (local time)
|
||||||
*
|
*
|
||||||
* Description: Replaces current alias with the given alias. To remove
|
* Description: Replaces current alias with the given alias. To remove
|
||||||
* the current alias, set alias_name to NULL.
|
* the current alias, set alias_name to NULL.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 - OK
|
* 0 - OK
|
||||||
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
* UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int web_server_set_alias( IN const char* alias_name,
|
int web_server_set_alias( IN const char* alias_name,
|
||||||
IN const char* alias_content, IN size_t alias_content_length,
|
IN const char* alias_content, IN size_t alias_content_length,
|
||||||
IN time_t last_modified );
|
IN time_t last_modified );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_set_root_dir
|
* Function: web_server_set_root_dir
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN const char* root_dir ; String having the root directory for the
|
* IN const char* root_dir ; String having the root directory for the
|
||||||
* document
|
* document
|
||||||
*
|
*
|
||||||
* Description: Assign the path specfied by the IN const char* root_dir
|
* Description: Assign the path specfied by the IN const char* root_dir
|
||||||
* parameter to the global Document root directory. Also check for
|
* parameter to the global Document root directory. Also check for
|
||||||
* path names ending in '/'
|
* path names ending in '/'
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* int
|
* int
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
int web_server_set_root_dir( IN const char* root_dir );
|
int web_server_set_root_dir( IN const char* root_dir );
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function: web_server_callback
|
* Function: web_server_callback *
|
||||||
*
|
* *
|
||||||
* Parameters:
|
* Parameters: *
|
||||||
* IN http_parser_t *parser,
|
* IN http_parser_t *parser, *
|
||||||
* INOUT http_message_t* req,
|
* INOUT http_message_t* req, *
|
||||||
* IN SOCKINFO *info
|
* IN SOCKINFO *info *
|
||||||
*
|
* *
|
||||||
* Description: main entry point into web server;
|
* Description: main entry point into web server; *
|
||||||
* handles HTTP GET and HEAD requests
|
* handles HTTP GET and HEAD requests *
|
||||||
*
|
* *
|
||||||
* Returns:
|
* Returns: *
|
||||||
* void
|
* void *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
void web_server_callback( IN http_parser_t *parser, IN http_message_t* req, INOUT SOCKINFO *info );
|
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
|
#endif // GENLIB_NET_HTTP_WEBSERVER_H
|
||||||
|
|
||||||
|
@@ -870,7 +870,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
"Error in socket operation !!!\n" );
|
"Error in socket operation !!!\n" );
|
||||||
|
|
||||||
return UPNP_E_OUTOF_SOCKET;
|
return UPNP_E_OUTOF_SOCKET;
|
||||||
}
|
}
|
||||||
setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
||||||
@@ -885,7 +884,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
"Error in socket operation !!!\n" );
|
"Error in socket operation !!!\n" );
|
||||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||||
|
|
||||||
return UPNP_E_OUTOF_SOCKET;
|
return UPNP_E_OUTOF_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,11 +897,10 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||||
shutdown( ssdpSock, SD_BOTH );
|
shutdown( ssdpSock, SD_BOTH );
|
||||||
UpnpCloseSocket( ssdpSock );
|
UpnpCloseSocket( ssdpSock );
|
||||||
|
|
||||||
return UPNP_E_SOCKET_ERROR;
|
return UPNP_E_SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__)
|
#ifdef __FreeBSD__
|
||||||
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT,
|
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT,
|
||||||
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
|
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
|
||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
@@ -913,7 +910,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||||
shutdown( ssdpSock, SD_BOTH );
|
shutdown( ssdpSock, SD_BOTH );
|
||||||
UpnpCloseSocket( ssdpSock );
|
UpnpCloseSocket( ssdpSock );
|
||||||
|
|
||||||
return UPNP_E_SOCKET_ERROR;
|
return UPNP_E_SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
#endif /* __FreeBSD__ */
|
#endif /* __FreeBSD__ */
|
||||||
@@ -932,7 +928,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
UpnpCloseSocket( ssdpSock );
|
UpnpCloseSocket( ssdpSock );
|
||||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||||
|
|
||||||
return UPNP_E_SOCKET_BIND;
|
return UPNP_E_SOCKET_BIND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -948,7 +943,6 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||||
UpnpCloseSocket( ssdpSock );
|
UpnpCloseSocket( ssdpSock );
|
||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||||
|
|
||||||
return UPNP_E_SOCKET_ERROR;
|
return UPNP_E_SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,13 +968,11 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
|
||||||
UpnpCloseSocket( ssdpSock );
|
UpnpCloseSocket( ssdpSock );
|
||||||
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
|
||||||
|
|
||||||
return UPNP_E_NETWORK_ERROR;
|
return UPNP_E_NETWORK_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLIENTONLY( out->ssdpReqSock = ssdpReqSock; )
|
CLIENTONLY( out->ssdpReqSock = ssdpReqSock; )
|
||||||
out->ssdpSock = ssdpSock;
|
out->ssdpSock = ssdpSock;
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user