Compare commits
35 Commits
release-1.
...
branch-1.4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eaaa721a15 | ||
![]() |
b09faaaec4 | ||
![]() |
881952bd0d | ||
![]() |
ec93478a4f | ||
![]() |
a7ab0acfe8 | ||
![]() |
85a8da77f2 | ||
![]() |
25620c1967 | ||
![]() |
8bc61b1a5c | ||
![]() |
aec58e6c9e | ||
![]() |
4bcb9dd5e1 | ||
![]() |
8cfa0e488c | ||
![]() |
9e775e662e | ||
![]() |
03400550cd | ||
![]() |
62a5d7c5ef | ||
![]() |
df80fbae36 | ||
![]() |
9c6ea48583 | ||
![]() |
8da593fae3 | ||
![]() |
b4816a33a9 | ||
![]() |
1b029e80af | ||
![]() |
907b103439 | ||
![]() |
ecd755d3f8 | ||
![]() |
b8cac59dd9 | ||
![]() |
591e0d3e25 | ||
![]() |
bd3bf7ad0a | ||
![]() |
374ff706fd | ||
![]() |
44564d16f8 | ||
![]() |
c0a5ccc174 | ||
![]() |
522dee807f | ||
![]() |
062d62bbc4 | ||
![]() |
ca1d800b96 | ||
![]() |
bd8ea3ac77 | ||
![]() |
191814ec13 | ||
![]() |
854cc93854 | ||
![]() |
6a0f25b290 | ||
![]() |
ed0a4d2222 |
176
ChangeLog
176
ChangeLog
@@ -1,121 +1,7 @@
|
|||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
Version 1.6.1
|
Version 1.4.7
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2007-11-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* SF Bug Tracker [ 1825278 ] AdvertiseAndReply sleeps with handle lock out
|
|
||||||
Applied patch from Alex (afaucher) to change some write locks to read
|
|
||||||
locks.
|
|
||||||
|
|
||||||
2007-11-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Adjusting libtool library numbers to reflect the last changes.
|
|
||||||
|
|
||||||
2007-11-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* SF Bug Tracker [ 1825278 ] AdvertiseAndReply sleeps with handle lock out
|
|
||||||
GlobalHndMutex, which was a mutex is now GlobalHndRWLock, which is a
|
|
||||||
rwlock. HandleLock() is mapped to HandleWriteLock() while all other
|
|
||||||
instances have not been checked. One instance in AdvertiseAndReply()
|
|
||||||
has been changed to HandleReadLock(). Thanks to Alex (afaucher) for the
|
|
||||||
bug report and suggestions.
|
|
||||||
|
|
||||||
2007-11-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Added support for rwlocks.
|
|
||||||
|
|
||||||
2007-11-05 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* SF Bug Tracker [ 1825929 ] woker thread still alive after UpnpFinish()
|
|
||||||
Submitted By: Luke Kim - nereusuj
|
|
||||||
Worker thread still alive after calling UpnpFinish() because
|
|
||||||
ThreadPoolShutdown() is in the #ifdef DEBUG block.
|
|
||||||
421
|
|
||||||
422 #ifdef DEBUG
|
|
||||||
423 ThreadPoolShutdown( &gSendThreadPool );
|
|
||||||
424 ThreadPoolShutdown( &gRecvThreadPool );
|
|
||||||
|
|
||||||
2007-08-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Changed the calls to virtualDirCallback.open(filename, UPNP_WRITE)
|
|
||||||
to (virtualDirCallback.open)(filename, UPNP_WRITE) (notice the
|
|
||||||
parenthesis) due to a change in glibc that produces compilation
|
|
||||||
errors.
|
|
||||||
|
|
||||||
2007-08-28 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Initialization of the "randomness" struct so that valgrind does not
|
|
||||||
complain.
|
|
||||||
|
|
||||||
2007-08-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Merge of patch submitted By Keith Brindley - brindlk
|
|
||||||
SF Bug Tracker [ 1762758 ] Seek not working for large files
|
|
||||||
Problem:
|
|
||||||
Requests from the uPnP client to seek to a position beyond 2GB in a large
|
|
||||||
file are handled as a request to see from the 2GB point.
|
|
||||||
|
|
||||||
Impact:
|
|
||||||
Varies depending on client. The Xbox 360 kills the connection when it
|
|
||||||
realises.
|
|
||||||
|
|
||||||
Solution:
|
|
||||||
GetNextRange function (webserver.c) is updated to handle large file sizes.
|
|
||||||
Fix should also recognise when built on a 32bit platform rather than 64 and
|
|
||||||
handle accordingly.
|
|
||||||
|
|
||||||
2007-08-05 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Merge of Mac OS X patch from St<53>phane Corth<74>sy (davelopper),
|
|
||||||
SF Bug Tracker [ 1686420 ] Modifications for MacOSX.
|
|
||||||
Some of the proposed changes were already done by Rene Hexel's patch.
|
|
||||||
|
|
||||||
*******************************************************************************
|
|
||||||
Version 1.6.0
|
|
||||||
*******************************************************************************
|
|
||||||
|
|
||||||
2007-06-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* More fixes to Mac OS X and NetBSD from Rene Hexel:
|
|
||||||
[pupnp-devel] NetBSD & Mac OS X packages and patches
|
|
||||||
|
|
||||||
Okay, I found a couple more things. I have attached a patch file
|
|
||||||
against the trunk (version 206) that make the repository code compile
|
|
||||||
and run on both Mac OS X and NetBSD.
|
|
||||||
|
|
||||||
This fixes the following issues:
|
|
||||||
|
|
||||||
upnp/src/api/upnpapi.c: SIOCGIFCONF didn't work properly, use
|
|
||||||
getifaddrs() instead (on BSD systems).
|
|
||||||
|
|
||||||
threadutil/src/ThreadPool.c: priorities only work if
|
|
||||||
_POSIX_PRIORITY_SCHEDULING is defined (and greater than 0).
|
|
||||||
|
|
||||||
threadutil/src/LinkedList.c and threadutil/src/iasnprintf.c: use
|
|
||||||
stdlib.h instead of malloc.h on all BSD systems (not just FreeBSD).
|
|
||||||
This is important, because malloc.h does not exist on Darwin/Mac OS X.
|
|
||||||
|
|
||||||
Cheers
|
|
||||||
,
|
|
||||||
Rene
|
|
||||||
|
|
||||||
2007-06-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* [pupnp-devel] NetBSD & Mac OS X packages and patches.
|
|
||||||
Rene Hexel's <rh@netbsd.org> patch to compile in NetBSD and Mac OS X.
|
|
||||||
|
|
||||||
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Updated the macro files acx_pthread.m4, ax_cflags_gcc_option.m4,
|
|
||||||
ax_cflags_warn_all.m4, m4/ax_cflags_warn_all_ansi.m4,
|
|
||||||
m4/type_socklen_t.m4.
|
|
||||||
|
|
||||||
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* Fixed an issue with the instalation of the file upnpdebug.h. Since
|
|
||||||
the last modifications that removed the macro DEBUV_ONLY, this file
|
|
||||||
must be installed even on a non-debug build.
|
|
||||||
|
|
||||||
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
|
||||||
* SF Bug Tracker [ 1711325 ] Bad DestAddr in Upnp_Discovery structure
|
|
||||||
Submitted By: Bob Ciora
|
|
||||||
The field DestAddr of the structure Upnp_Discovery is now a full
|
|
||||||
SOCKADDRIN instead of a pointer to SOCKADDRIN. Commented code sugests
|
|
||||||
that in a previous moment, the function ssdp_handle_ctrlpt_msg() did
|
|
||||||
not use a postponed thread to call ctrlpt_callback(). Now the code
|
|
||||||
uses a thread, and most probably the original data would get lost and
|
|
||||||
the pointer would point to an invalid memory region. This fix caused
|
|
||||||
an interface change in the library and the minor library version was
|
|
||||||
bumped. Also, the libtool library numbers were changed accordingly.
|
|
||||||
|
|
||||||
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
2007-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||||
* Added support for the Basic Device
|
* Added support for the Basic Device
|
||||||
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by
|
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by
|
||||||
@@ -478,14 +364,14 @@ Version 1.4.0
|
|||||||
FORK FROM DEAD libupnp
|
FORK FROM DEAD libupnp
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
|
|
||||||
2006-04-29 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-04-29 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* THANKS: new file with list of contributors
|
* THANKS: new file with list of contributors
|
||||||
|
|
||||||
* upnp/src/gena/gena_device.c (respond_ok): add 'Content-Length: 0'
|
* upnp/src/gena/gena_device.c (respond_ok): add 'Content-Length: 0'
|
||||||
in subscription response. Patch by Chaos (Bug # 1455367).
|
in subscription response. Patch by Chaos (Bug # 1455367).
|
||||||
|
|
||||||
2006-04-08 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-04-08 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/doc/UPnP_Programming_Guide.pdf: replace this document with
|
* upnp/doc/UPnP_Programming_Guide.pdf: replace this document with
|
||||||
the one in libupnp-doc-1.2.1 because current CVS version
|
the one in libupnp-doc-1.2.1 because current CVS version
|
||||||
@@ -496,20 +382,20 @@ FORK FROM DEAD libupnp
|
|||||||
* changes applied to several files to work under Sparc Solaris, temporarily
|
* changes applied to several files to work under Sparc Solaris, temporarily
|
||||||
requiring a define SPARC_SOLARIS
|
requiring a define SPARC_SOLARIS
|
||||||
|
|
||||||
2006-04-03 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-04-03 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/Makefile.am: install upnp samples in $(docdir)/examples
|
* upnp/Makefile.am: install upnp samples in $(docdir)/examples
|
||||||
|
|
||||||
2006-03-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* configure.ac: add --with-docdir option to choose where documentation
|
* configure.ac: add --with-docdir option to choose where documentation
|
||||||
is installed (or -without-docdir to not install the documentation)
|
is installed (or -without-docdir to not install the documentation)
|
||||||
|
|
||||||
2006-03-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* ixml/test: add simple test suite for xml parser
|
* ixml/test: add simple test suite for xml parser
|
||||||
|
|
||||||
2006-03-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* ixml/src/ixmlparser.c (Parser_processCDSect): fix bug which prevents
|
* ixml/src/ixmlparser.c (Parser_processCDSect): fix bug which prevents
|
||||||
CDATA sections which contain a 0 (zero) to be parsed (instead the
|
CDATA sections which contain a 0 (zero) to be parsed (instead the
|
||||||
@@ -520,18 +406,18 @@ FORK FROM DEAD libupnp
|
|||||||
option, and move samples compilation from check_PROGRAMS to
|
option, and move samples compilation from check_PROGRAMS to
|
||||||
noinst_PROGRAMS
|
noinst_PROGRAMS
|
||||||
|
|
||||||
2006-03-25 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-25 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/src/genlib/miniserver/miniserver.c (get_miniserver_sockets):
|
* upnp/src/genlib/miniserver/miniserver.c (get_miniserver_sockets):
|
||||||
fix bug if new socket created has fd 0 (can only occur when stdin
|
fix bug if new socket created has fd 0 (can only occur when stdin
|
||||||
has been closed). Patch by Oskar Liljeblad 2004-07-02 :
|
has been closed). Patch by Oskar Liljeblad 2004-07-02 :
|
||||||
http://sourceforge.net/mailarchive/message.php?msg_id=8870528
|
http://sourceforge.net/mailarchive/message.php?msg_id=8870528
|
||||||
|
|
||||||
2006-03-21 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-21 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/test/test_init.c: add some version checks and exit if failure
|
* upnp/test/test_init.c: add some version checks and exit if failure
|
||||||
|
|
||||||
2006-03-05 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-05 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* libupnp version 1.3.1
|
* libupnp version 1.3.1
|
||||||
|
|
||||||
@@ -546,11 +432,11 @@ FORK FROM DEAD libupnp
|
|||||||
dependencies between upnp and ixml / threadutil, so that programs
|
dependencies between upnp and ixml / threadutil, so that programs
|
||||||
linking against upnp only still work.
|
linking against upnp only still work.
|
||||||
|
|
||||||
2006-03-04 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-04 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* libupnp version 1.3.0
|
* libupnp version 1.3.0
|
||||||
|
|
||||||
2006-03-03 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-03-03 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/src/genlib/net/http/httpreadwrite.c (get_sdk_info): use
|
* upnp/src/genlib/net/http/httpreadwrite.c (get_sdk_info): use
|
||||||
package version string from configure to set sdk info
|
package version string from configure to set sdk info
|
||||||
@@ -558,7 +444,7 @@ FORK FROM DEAD libupnp
|
|||||||
* upnp/Makefile.am: add sample/tvdevice/web/ files in EXTRA_DIST
|
* upnp/Makefile.am: add sample/tvdevice/web/ files in EXTRA_DIST
|
||||||
+ do not distribute generated upnpconfig.h file.
|
+ do not distribute generated upnpconfig.h file.
|
||||||
|
|
||||||
2006-02-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-02-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/src/inc/config.h, configure.ac: use only new defines
|
* upnp/src/inc/config.h, configure.ac: use only new defines
|
||||||
UPNP_HAVE_xx instead of INCLUDE_yyy_APIS and INTERNAL_WEB_SERVER
|
UPNP_HAVE_xx instead of INCLUDE_yyy_APIS and INTERNAL_WEB_SERVER
|
||||||
@@ -567,7 +453,7 @@ FORK FROM DEAD libupnp
|
|||||||
the librarie LDFLAGS in order to export only the symbols defined
|
the librarie LDFLAGS in order to export only the symbols defined
|
||||||
in the API
|
in the API
|
||||||
|
|
||||||
2006-02-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-02-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* configure.ac: add libtool versions for the 3 libraries
|
* configure.ac: add libtool versions for the 3 libraries
|
||||||
|
|
||||||
@@ -575,7 +461,7 @@ FORK FROM DEAD libupnp
|
|||||||
|
|
||||||
* threadutil/src/ThreadPool.c (SetSeed): add missing 'static'
|
* threadutil/src/ThreadPool.c (SetSeed): add missing 'static'
|
||||||
|
|
||||||
2006-02-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-02-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* threadutil/inc/iasnprintf.h: add gcc __printf__ format attribute
|
* threadutil/inc/iasnprintf.h: add gcc __printf__ format attribute
|
||||||
to "iasnprintf"
|
to "iasnprintf"
|
||||||
@@ -596,11 +482,11 @@ FORK FROM DEAD libupnp
|
|||||||
the configuration of the installed libraries (generates installed
|
the configuration of the installed libraries (generates installed
|
||||||
file <upnp/upnpconfig.h>)
|
file <upnp/upnpconfig.h>)
|
||||||
|
|
||||||
2006-02-22 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-02-22 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/ : add missing include of config.h in some .c files
|
* upnp/ : add missing include of config.h in some .c files
|
||||||
|
|
||||||
2006-02-21 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-02-21 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/inc/upnp.h: move some definitions which should not be
|
* upnp/inc/upnp.h: move some definitions which should not be
|
||||||
exported into "upnp/src/inc/util.h"
|
exported into "upnp/src/inc/util.h"
|
||||||
@@ -608,12 +494,12 @@ FORK FROM DEAD libupnp
|
|||||||
* import all modifications below from libupnp in djmount 0.51
|
* import all modifications below from libupnp in djmount 0.51
|
||||||
into official libupnp
|
into official libupnp
|
||||||
|
|
||||||
2006-01-17 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-01-17 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* threadutil/Makefile.am (libthreadutil_la_SOURCES): remove extraneous
|
* threadutil/Makefile.am (libthreadutil_la_SOURCES): remove extraneous
|
||||||
file
|
file
|
||||||
|
|
||||||
2006-01-15 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-01-15 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* configure.ac: add checks for large-file support
|
* configure.ac: add checks for large-file support
|
||||||
|
|
||||||
@@ -633,53 +519,53 @@ FORK FROM DEAD libupnp
|
|||||||
* ixml/src/node.c (ixmlNode_getNodeType): fix compilation warning
|
* ixml/src/node.c (ixmlNode_getNodeType): fix compilation warning
|
||||||
on const return type
|
on const return type
|
||||||
|
|
||||||
2006-01-12 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-01-12 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/src/inc/readwrite.h : suppress unused C++ header file
|
* upnp/src/inc/readwrite.h : suppress unused C++ header file
|
||||||
|
|
||||||
2006-01-11 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2006-01-11 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/inc/config.h, upnp/src/inc/upnpapi.h,
|
* upnp/inc/config.h, upnp/src/inc/upnpapi.h,
|
||||||
upnp/src/inc/httpreadwrite.h: remove internal configuration variable
|
upnp/src/inc/httpreadwrite.h: remove internal configuration variable
|
||||||
MINIMUM_DELAY (no clear purpose)
|
MINIMUM_DELAY (no clear purpose)
|
||||||
|
|
||||||
2005-12-05 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-12-05 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/inc/upnp.h: re-declare obsolete method UpnpSetContentLength,
|
* upnp/inc/upnp.h: re-declare obsolete method UpnpSetContentLength,
|
||||||
for binary compatibility with previous libupnp version.
|
for binary compatibility with previous libupnp version.
|
||||||
|
|
||||||
* upnp/src/api/upnpapi.c: correct type of g_maxContentLength to size_t
|
* upnp/src/api/upnpapi.c: correct type of g_maxContentLength to size_t
|
||||||
|
|
||||||
2005-11-01 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-11-01 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* autoconfiscate library : replace all makefiles by Makefile.am
|
* autoconfiscate library : replace all makefiles by Makefile.am
|
||||||
for automake support, + preliminary autoconf support
|
for automake support, + preliminary autoconf support
|
||||||
(generated config.h not yet used in source files)
|
(generated config.h not yet used in source files)
|
||||||
|
|
||||||
2005-10-18 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-10-18 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/src/makefile: fix location of DEBUG STATIC libupnp library
|
* upnp/src/makefile: fix location of DEBUG STATIC libupnp library
|
||||||
|
|
||||||
* upnp/sample/tvctrlpt/linux/Makefile,
|
* upnp/sample/tvctrlpt/linux/Makefile,
|
||||||
upnp/sample/tvdevice/linux/Makefile: fix STATIC library support
|
upnp/sample/tvdevice/linux/Makefile: fix STATIC library support
|
||||||
|
|
||||||
2005-10-16 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-10-16 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* threadutil/src/Makefile (clean): remove built library
|
* threadutil/src/Makefile (clean): remove built library
|
||||||
|
|
||||||
2005-08-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-08-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* ixml/src/ixml.h, ixml/src/ixml.c (ixmlRelaxParser) : new function
|
* ixml/src/ixml.h, ixml/src/ixml.c (ixmlRelaxParser) : new function
|
||||||
|
|
||||||
* ixml/src/ixmlparser.h, ixml/src/ixmlparser.c (Parser_setErrorChar) :
|
* ixml/src/ixmlparser.h, ixml/src/ixmlparser.c (Parser_setErrorChar) :
|
||||||
new function
|
new function
|
||||||
|
|
||||||
2005-08-02 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-08-02 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* ixml/src/Makefile: correct bug for static library being incorrectly
|
* ixml/src/Makefile: correct bug for static library being incorrectly
|
||||||
stripped when building non-debug
|
stripped when building non-debug
|
||||||
|
|
||||||
2005-06-09 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-06-09 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* ixml/src/element.c (ixmlElement_removeAttributeNode):
|
* ixml/src/element.c (ixmlElement_removeAttributeNode):
|
||||||
remove some compilation warning
|
remove some compilation warning
|
||||||
@@ -690,7 +576,7 @@ FORK FROM DEAD libupnp
|
|||||||
* upnp/inc/upnptools.h, upnp/src/api/upnptools.c :
|
* upnp/inc/upnptools.h, upnp/src/api/upnptools.c :
|
||||||
add missing const's in public API
|
add missing const's in public API
|
||||||
|
|
||||||
2005-05-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-05-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/inc/config.h: suppress HTTP_READ_BYTES (unused)
|
* upnp/inc/config.h: suppress HTTP_READ_BYTES (unused)
|
||||||
and replace by DEFAULT_SOAP_CONTENT_LENGTH (previously in upnpapi.h)
|
and replace by DEFAULT_SOAP_CONTENT_LENGTH (previously in upnpapi.h)
|
||||||
@@ -711,7 +597,7 @@ FORK FROM DEAD libupnp
|
|||||||
* upnp/src/genlib/net/http/httpreadwrite.c : corrected an incorrect
|
* upnp/src/genlib/net/http/httpreadwrite.c : corrected an incorrect
|
||||||
sprintf format
|
sprintf format
|
||||||
|
|
||||||
2005-05-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-05-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/makefile, upnp/src/makefile,
|
* upnp/makefile, upnp/src/makefile,
|
||||||
ixml/Makefile, ixml/src/Makefile,
|
ixml/Makefile, ixml/src/Makefile,
|
||||||
@@ -719,7 +605,7 @@ FORK FROM DEAD libupnp
|
|||||||
implement STATIC library support (from patch at
|
implement STATIC library support (from patch at
|
||||||
http://sourceforge.net/tracker/?group_id=7189&atid=307189 )
|
http://sourceforge.net/tracker/?group_id=7189&atid=307189 )
|
||||||
|
|
||||||
2005-05-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
2005-05-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
|
||||||
|
|
||||||
* upnp/src/api/upnpapi.c, upnp/src/soap/soap_device.c,
|
* upnp/src/api/upnpapi.c, upnp/src/soap/soap_device.c,
|
||||||
upnp/src/soap/makefile :
|
upnp/src/soap/makefile :
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Top-level "Makefile.am" for libupnp
|
# Top-level "Makefile.am" for libupnp
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
2
README
2
README
@@ -1,7 +1,7 @@
|
|||||||
Portable SDK for UPnP* Devices (libupnp)
|
Portable SDK for UPnP* Devices (libupnp)
|
||||||
|
|
||||||
Copyright (c) 2000-2003 Intel Corporation - All Rights Reserved.
|
Copyright (c) 2000-2003 Intel Corporation - All Rights Reserved.
|
||||||
Copyright (c) 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
Copyright (c) 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
Copyright (c) 2006 Michel Pfeiffer and others <virtual_worlds@gmx.de>
|
Copyright (c) 2006 Michel Pfeiffer and others <virtual_worlds@gmx.de>
|
||||||
|
|
||||||
See LICENSE for details.
|
See LICENSE for details.
|
||||||
|
7
THANKS
7
THANKS
@@ -6,9 +6,7 @@ suggesting various improvements or submitting actual code.
|
|||||||
Here is a list of these people. Help us keep it complete and
|
Here is a list of these people. Help us keep it complete and
|
||||||
exempt of errors.
|
exempt of errors.
|
||||||
|
|
||||||
- Alex (afaucher)
|
|
||||||
- Arno Willig
|
- Arno Willig
|
||||||
- Bob Ciora
|
|
||||||
- Chaos
|
- Chaos
|
||||||
- Craig Nelson
|
- Craig Nelson
|
||||||
- David Maass
|
- David Maass
|
||||||
@@ -21,19 +19,16 @@ exempt of errors.
|
|||||||
- Jiri Zouhar
|
- Jiri Zouhar
|
||||||
- John Dennis
|
- John Dennis
|
||||||
- Jonathan (no_dice)
|
- Jonathan (no_dice)
|
||||||
- Keith Brindley
|
|
||||||
- Leuk_He
|
- Leuk_He
|
||||||
- Loigu
|
- Loigu
|
||||||
- Luke Kim
|
- Luke Kim
|
||||||
- Marcelo Roberto Jimenez (mroberto)
|
- Marcelo Roberto Jimenez
|
||||||
- Markus Strobl
|
- Markus Strobl
|
||||||
- Nektarios K. Papadopoulos
|
- Nektarios K. Papadopoulos
|
||||||
- Oskar Liljeblad
|
- Oskar Liljeblad
|
||||||
- Michael (Oxy)
|
- Michael (Oxy)
|
||||||
- Paul Vixie
|
- Paul Vixie
|
||||||
- Rene Hexel
|
|
||||||
- Siva Chandran
|
- Siva Chandran
|
||||||
- Stéphane Corthésy
|
|
||||||
- Timothy Redaelli
|
- Timothy Redaelli
|
||||||
- Titus Winters
|
- Titus Winters
|
||||||
|
|
||||||
|
@@ -261,7 +261,7 @@
|
|||||||
|
|
||||||
/** @name Other debugging features
|
/** @name Other debugging features
|
||||||
The UPnP SDK contains other features to aid in debugging:
|
The UPnP SDK contains other features to aid in debugging:
|
||||||
see <upnp/inc/upnpdebug.h>
|
see <upnp/upnpdebug.h>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DEBUG_ALL 1
|
#define DEBUG_ALL 1
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// -*- C -*-
|
// -*- C -*-
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
// Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
@@ -5,17 +5,17 @@
|
|||||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||||
|
|
||||||
CFG=libupnp - Win32 Debug
|
CFG=libupnp - Win32 Debug
|
||||||
!MESSAGE Dies ist kein g<>ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
|
!MESSAGE Dies ist kein g<>ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
|
||||||
!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f<>hren Sie den Befehl
|
!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f<>hren Sie den Befehl
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE NMAKE /f "libupnp.mak".
|
!MESSAGE NMAKE /f "libupnp.mak".
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE Sie k<>nnen beim Ausf<73>hren von NMAKE eine Konfiguration angeben
|
!MESSAGE Sie k<>nnen beim Ausf<73>hren von NMAKE eine Konfiguration angeben
|
||||||
!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
|
!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE NMAKE /f "libupnp.mak" CFG="libupnp - Win32 Debug"
|
!MESSAGE NMAKE /f "libupnp.mak" CFG="libupnp - Win32 Debug"
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE F<>r die Konfiguration stehen zur Auswahl:
|
!MESSAGE F<>r die Konfiguration stehen zur Auswahl:
|
||||||
!MESSAGE
|
!MESSAGE
|
||||||
!MESSAGE "libupnp - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
|
!MESSAGE "libupnp - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
|
||||||
!MESSAGE "libupnp - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
|
!MESSAGE "libupnp - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
|
||||||
|
74
configure.ac
74
configure.ac
@@ -4,15 +4,14 @@
|
|||||||
#
|
#
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
# (C) Copyright 2005-2007 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# (C) Copyright 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ(2.60)
|
||||||
|
|
||||||
AC_INIT([libupnp], [1.6.1], [mroberto@users.sourceforge.net])
|
AC_INIT([libupnp], [1.4.7], [mroberto@users.sourceforge.net])
|
||||||
###############################################################################
|
|
||||||
# *Independently* of the above libupnp package version, the libtool version
|
# *Independently* of the above libupnp package version, the libtool version
|
||||||
# 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 :
|
||||||
# "current:revision:age" (this is NOT the same as the package version), where:
|
# "current:revision:age" (this is NOT the same as the package version), where:
|
||||||
# - library code modified: revision++
|
# - library code modified: revision++
|
||||||
# - interfaces changed/added/removed: current++ and revision=0
|
# - interfaces changed/added/removed: current++ and revision=0
|
||||||
@@ -20,14 +19,11 @@ AC_INIT([libupnp], [1.6.1], [mroberto@users.sourceforge.net])
|
|||||||
# - interfaces removed: age=0
|
# - interfaces removed: age=0
|
||||||
# *please update only once, before a formal release, not for each change*
|
# *please update only once, before a formal release, not for each change*
|
||||||
#
|
#
|
||||||
###############################################################################
|
# For release 1.4.1, we had:
|
||||||
# Release 1.4.1:
|
|
||||||
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
#AC_SUBST([LT_VERSION_IXML], [2:2:0])
|
||||||
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
#AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0])
|
||||||
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
|
||||||
#
|
#
|
||||||
###############################################################################
|
|
||||||
# Release 1.4.6:
|
|
||||||
# "current:revision:age"
|
# "current:revision:age"
|
||||||
#
|
#
|
||||||
# - Code has changed in ixml
|
# - Code has changed in ixml
|
||||||
@@ -38,73 +34,19 @@ AC_INIT([libupnp], [1.6.1], [mroberto@users.sourceforge.net])
|
|||||||
# current: 2 -> 3
|
# current: 2 -> 3
|
||||||
# revisiion: 3 -> 0
|
# revisiion: 3 -> 0
|
||||||
# age: 0 -> 1
|
# age: 0 -> 1
|
||||||
# - Code has changed in upnp
|
# - Code has changed in upnp (revision 2 -> 3)
|
||||||
# revision: 2 -> 3
|
# revision: 2 -> 3
|
||||||
#
|
AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
||||||
#AC_SUBST([LT_VERSION_IXML], [2:3:0])
|
AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
||||||
#AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
|
AC_SUBST([LT_VERSION_UPNP], [2:3:0])
|
||||||
#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])
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
AC_SUBST([LT_VERSION_IXML], [2:4:0])
|
|
||||||
AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
|
|
||||||
AC_SUBST([LT_VERSION_UPNP], [3:1: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(config.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])
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Get canonical host names in host and host_os
|
# Get canonical host names in host and host_os
|
||||||
#
|
#
|
||||||
|
@@ -9,3 +9,4 @@ Version: @VERSION@
|
|||||||
Libs: @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
|
Libs: @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
|
||||||
Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp
|
Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Version: 1.4.2
|
Version: 1.4.7
|
||||||
Summary: Universal Plug and Play (UPnP) SDK
|
Summary: Universal Plug and Play (UPnP) SDK
|
||||||
Name: libupnp
|
Name: libupnp
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
@@ -77,6 +77,9 @@ make install DESTDIR=$RPM_BUILD_ROOT
|
|||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 19 2007 Marcelo Jimenez <mroberto@users.sourceforge.net> - 1.4.7-1
|
||||||
|
- Update to version 1.4.7
|
||||||
|
|
||||||
* Fri Feb 02 2007 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.2-1
|
* Fri Feb 02 2007 Eric Tanguy <eric.tanguy@univ-nantes.fr> - 1.4.2-1
|
||||||
- Update to version 1.4.2
|
- Update to version 1.4.2
|
||||||
|
|
||||||
|
@@ -1,88 +1,50 @@
|
|||||||
##### http://autoconf-archive.cryp.to/acx_pthread.html
|
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||||
#
|
dnl
|
||||||
# SYNOPSIS
|
dnl @summary figure out how to build C programs using POSIX threads
|
||||||
#
|
dnl
|
||||||
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
dnl This macro figures out how to build C programs using POSIX threads.
|
||||||
#
|
dnl It sets the PTHREAD_LIBS output variable to the threads library and
|
||||||
# DESCRIPTION
|
dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
|
||||||
#
|
dnl C compiler flags that are needed. (The user can also force certain
|
||||||
# This macro figures out how to build C programs using POSIX threads.
|
dnl compiler flags/libs to be tested by setting these environment
|
||||||
# It sets the PTHREAD_LIBS output variable to the threads library and
|
dnl variables.)
|
||||||
# linker flags, and the PTHREAD_CFLAGS output variable to any special
|
dnl
|
||||||
# C compiler flags that are needed. (The user can also force certain
|
dnl Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||||
# compiler flags/libs to be tested by setting these environment
|
dnl multi-threaded programs (defaults to the value of CC otherwise).
|
||||||
# variables.)
|
dnl (This is necessary on AIX to use the special cc_r compiler alias.)
|
||||||
#
|
dnl
|
||||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
dnl NOTE: You are assumed to not only compile your program with these
|
||||||
# multi-threaded programs (defaults to the value of CC otherwise).
|
dnl flags, but also link it with them as well. e.g. you should link
|
||||||
# (This is necessary on AIX to use the special cc_r compiler alias.)
|
dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
||||||
#
|
dnl $LIBS
|
||||||
# NOTE: You are assumed to not only compile your program with these
|
dnl
|
||||||
# flags, but also link it with them as well. e.g. you should link
|
dnl If you are only building threads programs, you may wish to use
|
||||||
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
|
dnl these variables in your default LIBS, CFLAGS, and CC:
|
||||||
# $LIBS
|
dnl
|
||||||
#
|
dnl LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
# If you are only building threads programs, you may wish to use
|
dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
# these variables in your default LIBS, CFLAGS, and CC:
|
dnl CC="$PTHREAD_CC"
|
||||||
#
|
dnl
|
||||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
||||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
||||||
# CC="$PTHREAD_CC"
|
dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||||
#
|
dnl
|
||||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
|
dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
|
||||||
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
|
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
||||||
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
||||||
#
|
dnl default action will define HAVE_PTHREAD.
|
||||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads
|
dnl
|
||||||
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
|
dnl Please let the authors know if this macro fails on any platform, or
|
||||||
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
|
dnl if you have any other suggestions or comments. This macro was based
|
||||||
# default action will define HAVE_PTHREAD.
|
dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
|
||||||
#
|
dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
|
||||||
# Please let the authors know if this macro fails on any platform, or
|
dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
|
||||||
# if you have any other suggestions or comments. This macro was based
|
dnl We are also grateful for the helpful feedback of numerous users.
|
||||||
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
|
dnl
|
||||||
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
|
dnl @category InstalledPackages
|
||||||
# macros posted by Alejandro Forero Cuervo to the autoconf macro
|
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
|
||||||
# repository. We are also grateful for the helpful feedback of
|
dnl @version 2005-06-15
|
||||||
# numerous users.
|
dnl @license GPLWithACException
|
||||||
#
|
|
||||||
# LAST MODIFICATION
|
|
||||||
#
|
|
||||||
# 2006-05-29
|
|
||||||
#
|
|
||||||
# COPYLEFT
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006 Steven G. Johnson <stevenj@alum.mit.edu>
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 2 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# As a special exception, the respective Autoconf Macro's copyright
|
|
||||||
# owner gives unlimited permission to copy, distribute and modify the
|
|
||||||
# configure scripts that are the output of Autoconf when processing
|
|
||||||
# the Macro. You need not follow the terms of the GNU General Public
|
|
||||||
# License when using or distributing such scripts, even though
|
|
||||||
# portions of the text of the Macro appear in them. The GNU General
|
|
||||||
# Public License (GPL) does govern all other use of the material that
|
|
||||||
# constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the
|
|
||||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
|
||||||
# make and distribute a modified version of the Autoconf Macro, you
|
|
||||||
# may extend this special exception to the GPL to apply to your
|
|
||||||
# modified version as well.
|
|
||||||
|
|
||||||
AC_DEFUN([ACX_PTHREAD], [
|
AC_DEFUN([ACX_PTHREAD], [
|
||||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
@@ -254,12 +216,8 @@ if test "x$acx_pthread_ok" = xyes; then
|
|||||||
LIBS="$save_LIBS"
|
LIBS="$save_LIBS"
|
||||||
CFLAGS="$save_CFLAGS"
|
CFLAGS="$save_CFLAGS"
|
||||||
|
|
||||||
# More AIX lossage: must compile with xlc_r or cc_r
|
# More AIX lossage: must compile with cc_r
|
||||||
if test x"$GCC" != xyes; then
|
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
|
||||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
|
||||||
else
|
|
||||||
PTHREAD_CC=$CC
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
PTHREAD_CC="$CC"
|
PTHREAD_CC="$CC"
|
||||||
fi
|
fi
|
||||||
|
@@ -1,87 +1,48 @@
|
|||||||
##### http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
|
dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
|
||||||
#
|
dnl
|
||||||
# SYNOPSIS
|
dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
|
||||||
#
|
dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
|
||||||
# AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
|
dnl optionflag to CFLAGS if it is understood. You can override the
|
||||||
#
|
dnl shellvar-default of CFLAGS of course. The order of arguments stems
|
||||||
# DESCRIPTION
|
dnl from the explicit macros like AX_CFLAGS_WARN_ALL.
|
||||||
#
|
dnl
|
||||||
# AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
|
dnl The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
|
||||||
# "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
|
dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
|
||||||
# optionflag to CFLAGS if it is understood. You can override the
|
dnl (since it is possible to use different compilers for C and C++).
|
||||||
# shellvar-default of CFLAGS of course. The order of arguments stems
|
dnl
|
||||||
# from the explicit macros like AX_CFLAGS_WARN_ALL.
|
dnl The macro is a lot simpler than any special AX_CFLAGS_* macro (or
|
||||||
#
|
dnl ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
|
||||||
# The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
|
dnl However, if you use this macro in a few places, it would be great
|
||||||
# to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
|
dnl if you would make up a new function-macro and submit it to the
|
||||||
# (since it is possible to use different compilers for C and C++).
|
dnl ac-archive.
|
||||||
#
|
dnl
|
||||||
# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
|
dnl - $1 option-to-check-for : required ("-option" as non-value)
|
||||||
# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
|
dnl - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
|
||||||
# However, if you use this macro in a few places, it would be great
|
dnl - $3 action-if-found : add value to shellvariable
|
||||||
# if you would make up a new function-macro and submit it to the
|
dnl - $4 action-if-not-found : nothing
|
||||||
# ac-archive.
|
dnl
|
||||||
#
|
dnl note: in earlier versions, $1-$2 were swapped. We try to detect the
|
||||||
# - $1 option-to-check-for : required ("-option" as non-value)
|
dnl situation and accept a $2=~/-/ as being the old
|
||||||
# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
|
dnl option-to-check-for.
|
||||||
# - $3 action-if-found : add value to shellvariable
|
dnl
|
||||||
# - $4 action-if-not-found : nothing
|
dnl also: there are other variants that emerged from the original macro
|
||||||
#
|
dnl variant which did just test an option to be possibly added.
|
||||||
# note: in earlier versions, $1-$2 were swapped. We try to detect the
|
dnl However, some compilers accept an option silently, or possibly for
|
||||||
# situation and accept a $2=~/-/ as being the old
|
dnl just another option that was not intended. Therefore, we have to do
|
||||||
# option-to-check-for.
|
dnl a generic test for a compiler family. For gcc we check "-pedantic"
|
||||||
#
|
dnl being accepted which is also understood by compilers who just want
|
||||||
# also: there are other variants that emerged from the original macro
|
dnl to be compatible with gcc even when not being made from gcc
|
||||||
# variant which did just test an option to be possibly added.
|
dnl sources.
|
||||||
# However, some compilers accept an option silently, or possibly for
|
dnl
|
||||||
# just another option that was not intended. Therefore, we have to do
|
dnl see also:
|
||||||
# a generic test for a compiler family. For gcc we check "-pedantic"
|
dnl
|
||||||
# being accepted which is also understood by compilers who just want
|
dnl AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
|
||||||
# to be compatible with gcc even when not being made from gcc
|
dnl AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION
|
||||||
# sources.
|
dnl
|
||||||
#
|
dnl @category C
|
||||||
# see also:
|
dnl @author Guido Draheim <guidod@gmx.de>
|
||||||
#
|
dnl @version 2003-11-04
|
||||||
# AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
|
dnl @license GPLWithACException
|
||||||
# AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION
|
|
||||||
#
|
|
||||||
# LAST MODIFICATION
|
|
||||||
#
|
|
||||||
# 2006-12-12
|
|
||||||
#
|
|
||||||
# COPYLEFT
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 2 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# As a special exception, the respective Autoconf Macro's copyright
|
|
||||||
# owner gives unlimited permission to copy, distribute and modify the
|
|
||||||
# configure scripts that are the output of Autoconf when processing
|
|
||||||
# the Macro. You need not follow the terms of the GNU General Public
|
|
||||||
# License when using or distributing such scripts, even though
|
|
||||||
# portions of the text of the Macro appear in them. The GNU General
|
|
||||||
# Public License (GPL) does govern all other use of the material that
|
|
||||||
# constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the
|
|
||||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
|
||||||
# make and distribute a modified version of the Autoconf Macro, you
|
|
||||||
# may extend this special exception to the GPL to apply to your
|
|
||||||
# modified version as well.
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
|
AC_DEFUN([AX_CFLAGS_GCC_OPTION_OLD], [dnl
|
||||||
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
||||||
@@ -92,8 +53,7 @@ VAR,[VAR="no, unknown"
|
|||||||
AC_LANG_C
|
AC_LANG_C
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
|
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
|
||||||
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
|
|
||||||
#
|
#
|
||||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||||
AC_TRY_COMPILE([],[return 0;],
|
AC_TRY_COMPILE([],[return 0;],
|
||||||
@@ -125,11 +85,10 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$2])dnl
|
|||||||
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
|
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for gcc m4_ifval($2,$2,-option)],
|
||||||
VAR,[VAR="no, unknown"
|
VAR,[VAR="no, unknown"
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CXX
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic -Werror % m4_ifval($2,$2,-option)" dnl GCC
|
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
|
||||||
"-pedantic % m4_ifval($2,$2,-option) %% no, obsolete" dnl new GCC
|
|
||||||
#
|
#
|
||||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||||
AC_TRY_COMPILE([],[return 0;],
|
AC_TRY_COMPILE([],[return 0;],
|
||||||
@@ -163,8 +122,7 @@ VAR,[VAR="no, unknown"
|
|||||||
AC_LANG_C
|
AC_LANG_C
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
|
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
|
||||||
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
|
|
||||||
#
|
#
|
||||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||||
AC_TRY_COMPILE([],[return 0;],
|
AC_TRY_COMPILE([],[return 0;],
|
||||||
@@ -196,11 +154,10 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_gcc_option_$1])dnl
|
|||||||
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
|
AC_CACHE_CHECK([m4_ifval($2,$2,FLAGS) for gcc m4_ifval($1,$1,-option)],
|
||||||
VAR,[VAR="no, unknown"
|
VAR,[VAR="no, unknown"
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CXX
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic -Werror % m4_ifval($1,$1,-option)" dnl GCC
|
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
|
||||||
"-pedantic % m4_ifval($1,$1,-option) %% no, obsolete" dnl new GCC
|
|
||||||
#
|
#
|
||||||
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
|
||||||
AC_TRY_COMPILE([],[return 0;],
|
AC_TRY_COMPILE([],[return 0;],
|
||||||
|
@@ -1,66 +1,27 @@
|
|||||||
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
|
dnl @synopsis AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
||||||
#
|
dnl
|
||||||
# SYNOPSIS
|
dnl Try to find a compiler option that enables most reasonable
|
||||||
#
|
dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
||||||
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
|
dnl which is split up into two AX_CFLAGS_WARN_ALL and
|
||||||
#
|
dnl AX_CFLAGS_WARN_ALL_ANSI
|
||||||
# DESCRIPTION
|
dnl
|
||||||
#
|
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
||||||
# Try to find a compiler option that enables most reasonable
|
dnl result is added to the shellvar being CFLAGS by default.
|
||||||
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
dnl
|
||||||
# which is split up into two AX_CFLAGS_WARN_ALL and
|
dnl Currently this macro knows about GCC, Solaris C compiler, Digital
|
||||||
# AX_CFLAGS_WARN_ALL_ANSI
|
dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
||||||
#
|
dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
||||||
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
dnl 10.0.0.8) C compiler.
|
||||||
# result is added to the shellvar being CFLAGS by default.
|
dnl
|
||||||
#
|
dnl - $1 shell-variable-to-add-to : CFLAGS
|
||||||
# Currently this macro knows about GCC, Solaris C compiler, Digital
|
dnl - $2 add-value-if-not-found : nothing
|
||||||
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
dnl - $3 action-if-found : add value to shellvariable
|
||||||
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
dnl - $4 action-if-not-found : nothing
|
||||||
# 10.0.0.8) C compiler.
|
dnl
|
||||||
#
|
dnl @category C
|
||||||
# - $1 shell-variable-to-add-to : CFLAGS
|
dnl @author Guido Draheim <guidod@gmx.de>
|
||||||
# - $2 add-value-if-not-found : nothing
|
dnl @version 2003-01-06
|
||||||
# - $3 action-if-found : add value to shellvariable
|
dnl @license GPLWithACException
|
||||||
# - $4 action-if-not-found : nothing
|
|
||||||
#
|
|
||||||
# LAST MODIFICATION
|
|
||||||
#
|
|
||||||
# 2006-12-12
|
|
||||||
#
|
|
||||||
# COPYLEFT
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 2 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# As a special exception, the respective Autoconf Macro's copyright
|
|
||||||
# owner gives unlimited permission to copy, distribute and modify the
|
|
||||||
# configure scripts that are the output of Autoconf when processing
|
|
||||||
# the Macro. You need not follow the terms of the GNU General Public
|
|
||||||
# License when using or distributing such scripts, even though
|
|
||||||
# portions of the text of the Macro appear in them. The GNU General
|
|
||||||
# Public License (GPL) does govern all other use of the material that
|
|
||||||
# constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the
|
|
||||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
|
||||||
# make and distribute a modified version of the Autoconf Macro, you
|
|
||||||
# may extend this special exception to the GPL to apply to your
|
|
||||||
# modified version as well.
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
|
AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
|
||||||
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
||||||
@@ -111,7 +72,7 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
|
|||||||
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
|
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
|
||||||
VAR,[VAR="no, unknown"
|
VAR,[VAR="no, unknown"
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CXX
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
for ac_arg dnl
|
for ac_arg dnl
|
||||||
in "-pedantic % -Wall" dnl GCC
|
in "-pedantic % -Wall" dnl GCC
|
||||||
@@ -154,5 +115,4 @@ dnl compilers will fail about it. That was needed since a lot of
|
|||||||
dnl compilers will give false positives for some option-syntax
|
dnl compilers will give false positives for some option-syntax
|
||||||
dnl like -Woption or -Xoption as they think of it is a pass-through
|
dnl like -Woption or -Xoption as they think of it is a pass-through
|
||||||
dnl to later compile stages or something. The "%" is used as a
|
dnl to later compile stages or something. The "%" is used as a
|
||||||
dnl delimimiter. A non-option comment can be given after "%%" marks
|
dnl delimimiter. A non-option comment can be given after "%%" marks.
|
||||||
dnl which will be shown but not added to the respective C/CXXFLAGS.
|
|
||||||
|
@@ -1,66 +1,27 @@
|
|||||||
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all_ansi.html
|
dnl @synopsis AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
|
||||||
#
|
dnl
|
||||||
# SYNOPSIS
|
dnl Try to find a compiler option that enables most reasonable
|
||||||
#
|
dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
||||||
# AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
|
dnl which is split up into two AX_CFLAGS_WARN_ALL and
|
||||||
#
|
dnl AX_CFLAGS_WARN_ALL_ANSI
|
||||||
# DESCRIPTION
|
dnl
|
||||||
#
|
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
||||||
# Try to find a compiler option that enables most reasonable
|
dnl result is added to the shellvar being CFLAGS by default.
|
||||||
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
|
dnl
|
||||||
# which is split up into two AX_CFLAGS_WARN_ALL and
|
dnl Currently this macro knows about GCC, Solaris C compiler, Digital
|
||||||
# AX_CFLAGS_WARN_ALL_ANSI
|
dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
||||||
#
|
dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
||||||
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
|
dnl 10.0.0.8) C compiler.
|
||||||
# result is added to the shellvar being CFLAGS by default.
|
dnl
|
||||||
#
|
dnl - $1 shell-variable-to-add-to : CFLAGS
|
||||||
# Currently this macro knows about GCC, Solaris C compiler, Digital
|
dnl - $2 add-value-if-not-found : nothing
|
||||||
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
|
dnl - $3 action-if-found : add value to shellvariable
|
||||||
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
|
dnl - $4 action-if-not-found : nothing
|
||||||
# 10.0.0.8) C compiler.
|
dnl
|
||||||
#
|
dnl @category C
|
||||||
# - $1 shell-variable-to-add-to : CFLAGS
|
dnl @author Guido Draheim <guidod@gmx.de>
|
||||||
# - $2 add-value-if-not-found : nothing
|
dnl @version 2003-01-06
|
||||||
# - $3 action-if-found : add value to shellvariable
|
dnl @license GPLWithACException
|
||||||
# - $4 action-if-not-found : nothing
|
|
||||||
#
|
|
||||||
# LAST MODIFICATION
|
|
||||||
#
|
|
||||||
# 2006-12-12
|
|
||||||
#
|
|
||||||
# COPYLEFT
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de>
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 2 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# As a special exception, the respective Autoconf Macro's copyright
|
|
||||||
# owner gives unlimited permission to copy, distribute and modify the
|
|
||||||
# configure scripts that are the output of Autoconf when processing
|
|
||||||
# the Macro. You need not follow the terms of the GNU General Public
|
|
||||||
# License when using or distributing such scripts, even though
|
|
||||||
# portions of the text of the Macro appear in them. The GNU General
|
|
||||||
# Public License (GPL) does govern all other use of the material that
|
|
||||||
# constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the
|
|
||||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
|
||||||
# make and distribute a modified version of the Autoconf Macro, you
|
|
||||||
# may extend this special exception to the GPL to apply to your
|
|
||||||
# modified version as well.
|
|
||||||
|
|
||||||
AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl
|
AC_DEFUN([AX_CFLAGS_WARN_ALL_ANSI],[dnl
|
||||||
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
|
||||||
@@ -116,7 +77,7 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all_ansi])dnl
|
|||||||
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
|
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
|
||||||
VAR,[VAR="no, unknown"
|
VAR,[VAR="no, unknown"
|
||||||
AC_LANG_SAVE
|
AC_LANG_SAVE
|
||||||
AC_LANG_CPLUSPLUS
|
AC_LANG_CXX
|
||||||
ac_save_[]FLAGS="$[]FLAGS"
|
ac_save_[]FLAGS="$[]FLAGS"
|
||||||
# IRIX C compiler:
|
# IRIX C compiler:
|
||||||
# -use_readonly_const is the default for IRIX C,
|
# -use_readonly_const is the default for IRIX C,
|
||||||
|
@@ -1,52 +1,13 @@
|
|||||||
##### http://autoconf-archive.cryp.to/type_socklen_t.html
|
dnl @synopsis TYPE_SOCKLEN_T
|
||||||
#
|
dnl
|
||||||
# SYNOPSIS
|
dnl Check whether sys/socket.h defines type socklen_t. Please note that
|
||||||
#
|
dnl some systems require sys/types.h to be included before sys/socket.h
|
||||||
# TYPE_SOCKLEN_T
|
dnl can be compiled.
|
||||||
#
|
dnl
|
||||||
# DESCRIPTION
|
dnl @category Misc
|
||||||
#
|
dnl @author Lars Brinkhoff <lars@nocrew.org>
|
||||||
# Check whether sys/socket.h defines type socklen_t. Please note that
|
dnl @version 2005-01-11
|
||||||
# some systems require sys/types.h to be included before sys/socket.h
|
dnl @license GPLWithACException
|
||||||
# can be compiled.
|
|
||||||
#
|
|
||||||
# LAST MODIFICATION
|
|
||||||
#
|
|
||||||
# 2005-01-11
|
|
||||||
#
|
|
||||||
# COPYLEFT
|
|
||||||
#
|
|
||||||
# Copyright (c) 2005 Lars Brinkhoff <lars@nocrew.org>
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 2 of the
|
|
||||||
# License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# As a special exception, the respective Autoconf Macro's copyright
|
|
||||||
# owner gives unlimited permission to copy, distribute and modify the
|
|
||||||
# configure scripts that are the output of Autoconf when processing
|
|
||||||
# the Macro. You need not follow the terms of the GNU General Public
|
|
||||||
# License when using or distributing such scripts, even though
|
|
||||||
# portions of the text of the Macro appear in them. The GNU General
|
|
||||||
# Public License (GPL) does govern all other use of the material that
|
|
||||||
# constitutes the Autoconf Macro.
|
|
||||||
#
|
|
||||||
# This special exception to the GPL applies to versions of the
|
|
||||||
# Autoconf Macro released by the Autoconf Macro Archive. When you
|
|
||||||
# make and distribute a modified version of the Autoconf Macro, you
|
|
||||||
# may extend this special exception to the GPL to apply to your
|
|
||||||
# modified version as well.
|
|
||||||
|
|
||||||
AC_DEFUN([TYPE_SOCKLEN_T],
|
AC_DEFUN([TYPE_SOCKLEN_T],
|
||||||
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
|
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
|
||||||
|
@@ -547,10 +547,6 @@ int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal);
|
|||||||
EXPORT int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats);
|
EXPORT int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats);
|
||||||
|
|
||||||
EXPORT void ThreadPoolPrintStats(ThreadPoolStats *stats);
|
EXPORT void ThreadPoolPrintStats(ThreadPoolStats *stats);
|
||||||
#else
|
|
||||||
static UPNP_INLINE int ThreadPoolGetStats(ThreadPool *tp, ThreadPoolStats *stats) {}
|
|
||||||
|
|
||||||
static UPNP_INLINE void ThreadPoolPrintStats(ThreadPoolStats *stats) {}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -42,31 +42,26 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||||
/* This system has SuS2-compliant mutex attributes.
|
/* This system has SuS2-compliant mutex attributes.
|
||||||
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
|
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
|
||||||
*/
|
*/
|
||||||
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
|
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_NORMAL
|
||||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
|
||||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
|
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
|
||||||
#else /* PTHREAD_MUTEX_RECURSIVE */
|
#else
|
||||||
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
|
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
|
||||||
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
|
||||||
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
|
||||||
#endif /* PTHREAD_MUTEX_RECURSIVE */
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ITHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
|
|
||||||
#define ITHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
|
|
||||||
|
|
||||||
|
|
||||||
#define ITHREAD_CANCELED PTHREAD_CANCELED
|
#define ITHREAD_CANCELED PTHREAD_CANCELED
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Name: ithread_t
|
* Name: ithread_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -74,9 +69,9 @@ extern "C" {
|
|||||||
* typedef to pthread_t.
|
* typedef to pthread_t.
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_t ithread_t;
|
typedef pthread_t ithread_t;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_attr_t
|
* Name: ithread_attr_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -84,20 +79,20 @@ typedef pthread_t ithread_t;
|
|||||||
* typedef to pthread_attr_t
|
* typedef to pthread_attr_t
|
||||||
* Internal Use Only
|
* Internal Use Only
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_attr_t ithread_attr_t;
|
typedef pthread_attr_t ithread_attr_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: start_routine
|
* Name: start_routine
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Thread start routine
|
* Thread start routine
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef void * (*start_routine) (void *arg);
|
typedef void * (*start_routine) (void *arg);
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_cond_t
|
* Name: ithread_cond_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -105,10 +100,10 @@ typedef void * (*start_routine) (void *arg);
|
|||||||
* typedef to pthread_cond_t
|
* typedef to pthread_cond_t
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_cond_t ithread_cond_t;
|
typedef pthread_cond_t ithread_cond_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_mutexattr_t
|
* Name: ithread_mutexattr_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -116,10 +111,10 @@ typedef pthread_cond_t ithread_cond_t;
|
|||||||
* typedef to pthread_mutexattr_t
|
* typedef to pthread_mutexattr_t
|
||||||
* Internal Use Only
|
* Internal Use Only
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_mutexattr_t ithread_mutexattr_t;
|
typedef pthread_mutexattr_t ithread_mutexattr_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_mutex_t
|
* Name: ithread_mutex_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -127,10 +122,10 @@ typedef pthread_mutexattr_t ithread_mutexattr_t;
|
|||||||
* typedef to pthread_mutex_t
|
* typedef to pthread_mutex_t
|
||||||
* Internal Use Only.
|
* Internal Use Only.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_mutex_t ithread_mutex_t;
|
typedef pthread_mutex_t ithread_mutex_t;
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ithread_condattr_t
|
* Name: ithread_condattr_t
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -139,31 +134,9 @@ typedef pthread_mutex_t ithread_mutex_t;
|
|||||||
* NOT USED
|
* NOT USED
|
||||||
* Internal Use Only
|
* Internal Use Only
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
typedef pthread_condattr_t ithread_condattr_t;
|
typedef pthread_condattr_t ithread_condattr_t;
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
/****************************************************************************
|
|
||||||
* Name: ithread_rwlockattr_t
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Mutex attribute.
|
|
||||||
* typedef to pthread_rwlockattr_t
|
|
||||||
* Internal Use Only
|
|
||||||
***************************************************************************/
|
|
||||||
typedef pthread_rwlockattr_t ithread_rwlockattr_t;
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: ithread_rwlock_t
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Condition attribute.
|
|
||||||
* typedef to pthread_rwlock_t
|
|
||||||
* Internal Use Only
|
|
||||||
***************************************************************************/
|
|
||||||
typedef pthread_rwlock_t ithread_rwlock_t;
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_mutexattr_init
|
* Function: ithread_mutexattr_init
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -177,10 +150,10 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
* See man page for pthread_mutexattr_init
|
* See man page for pthread_mutexattr_init
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#define ithread_mutexattr_init pthread_mutexattr_init
|
#define ithread_mutexattr_init pthread_mutexattr_init
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_mutexattr_destroy
|
* Function: ithread_mutexattr_destroy
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -207,7 +180,7 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
* ITHREAD_MUTEX_ERRORCHECK_NP
|
* ITHREAD_MUTEX_ERRORCHECK_NP
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ithread_mutexattr_t * attr (must be valid non NULL pointer to
|
* ithread_mutexattr_t * mutex (must be valid non NULL pointer to
|
||||||
* ithread_mutexattr_t)
|
* ithread_mutexattr_t)
|
||||||
* int kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
|
* int kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
|
||||||
* or ITHREAD_MUTEX_ERRORCHECK_NP)
|
* or ITHREAD_MUTEX_ERRORCHECK_NP)
|
||||||
@@ -217,9 +190,9 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
* See man page for pthread_mutexattr_setkind_np
|
* See man page for pthread_mutexattr_setkind_np
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||||
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
|
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
|
||||||
#else
|
#else
|
||||||
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
|
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -232,7 +205,7 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
* ITHREAD_MUTEX_ERRORCHECK_NP
|
* ITHREAD_MUTEX_ERRORCHECK_NP
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ithread_mutexattr_t * attr (must be valid non NULL pointer to
|
* ithread_mutexattr_t * mutex (must be valid non NULL pointer to
|
||||||
* pthread_mutexattr_t)
|
* pthread_mutexattr_t)
|
||||||
* int *kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
|
* int *kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
|
||||||
* or ITHREAD_MUTEX_ERRORCHECK_NP)
|
* or ITHREAD_MUTEX_ERRORCHECK_NP)
|
||||||
@@ -242,9 +215,9 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
* See man page for pthread_mutexattr_getkind_np
|
* See man page for pthread_mutexattr_getkind_np
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#ifdef PTHREAD_MUTEX_RECURSIVE
|
#ifdef PTHREAD_MUTEX_RECURSIVE
|
||||||
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
|
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
|
||||||
#else
|
#else
|
||||||
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
|
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -265,7 +238,6 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#define ithread_mutex_init pthread_mutex_init
|
#define ithread_mutex_init pthread_mutex_init
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ithread_mutex_lock
|
* Function: ithread_mutex_lock
|
||||||
*
|
*
|
||||||
@@ -320,169 +292,6 @@ typedef pthread_rwlock_t ithread_rwlock_t;
|
|||||||
#define ithread_mutex_destroy pthread_mutex_destroy
|
#define ithread_mutex_destroy pthread_mutex_destroy
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlockattr_init
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Initializes a rwlock attribute variable to default values.
|
|
||||||
* Parameters:
|
|
||||||
* const ithread_rwlockattr_init *attr (must be valid non NULL pointer to
|
|
||||||
* pthread_rwlockattr_t)
|
|
||||||
* Returns:
|
|
||||||
* 0 on success, Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlockattr_init
|
|
||||||
***************************************************************************/
|
|
||||||
#define ithread_rwlockattr_init pthread_rwlockattr_init
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlockattr_destroy
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Releases any resources held by the rwlock attribute.
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlockattr_t *attr (must be valid non NULL pointer to
|
|
||||||
* pthread_rwlockattr_t)
|
|
||||||
* Returns:
|
|
||||||
* 0 on success, Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlockattr_destroy
|
|
||||||
***************************************************************************/
|
|
||||||
#define ithread_rwlockattr_destroy pthread_rwlockattr_destroy
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlockatttr_setpshared
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Sets the rwlock type in the attribute.
|
|
||||||
* Valid types are: ITHREAD_PROCESS_PRIVATE
|
|
||||||
* ITHREAD_PROCESS_SHARED
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlockattr_t * attr (must be valid non NULL pointer to
|
|
||||||
* ithread_rwlockattr_t)
|
|
||||||
* int kind (one of ITHREAD_PROCESS_PRIVATE or ITHREAD_PROCESS_SHARED)
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* 0 on success. Nonzero on failure.
|
|
||||||
* Returns EINVAL if the kind is not supported.
|
|
||||||
* See man page for pthread_rwlockattr_setkind_np
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlockatttr_setpshared pthread_rwlockatttr_setpshared
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlockatttr_getpshared
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Gets the rwlock type in the attribute.
|
|
||||||
* Valid types are: ITHREAD_PROCESS_PRIVATE
|
|
||||||
* ITHREAD_PROCESS_SHARED
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlockattr_t * attr (must be valid non NULL pointer to
|
|
||||||
* pthread_rwlockattr_t)
|
|
||||||
* int *kind (one of ITHREAD_PROCESS_PRIVATE or ITHREAD_PROCESS_SHARED)
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* 0 on success. Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlockatttr_getpshared
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlockatttr_getpshared pthread_rwlockatttr_getpshared
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlock_init
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Initializes rwlock.
|
|
||||||
* Must be called before use.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlock_t * rwlock (must be valid non NULL pointer to pthread_rwlock_t)
|
|
||||||
* const ithread_rwlockattr_t * rwlock_attr
|
|
||||||
* Returns:
|
|
||||||
* 0 on success, Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlock_init
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlock_init pthread_rwlock_init
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlock_rdlock
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Locks rwlock for reading.
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlock_t * rwlock (must be valid non NULL pointer to pthread_rwlock_t)
|
|
||||||
* rwlock must be initialized.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* 0 on success, Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlock_rdlock
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlock_rdlock pthread_rwlock_rdlock
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlock_wrlock
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Locks rwlock for writting.
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlock_t * rwlock (must be valid non NULL pointer to pthread_rwlock_t)
|
|
||||||
* rwlock must be initialized.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* 0 on success, Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlock_wrlock
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlock_wrlock pthread_rwlock_wrlock
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlock_unlock
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Unlocks rwlock.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlock_t * rwlock (must be valid non NULL pointer to pthread_rwlock_t)
|
|
||||||
* rwlock must be initialized.
|
|
||||||
*
|
|
||||||
* Returns:
|
|
||||||
* 0 on success, Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlock_unlock
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlock_unlock pthread_rwlock_unlock
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: ithread_rwlock_destroy
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Releases any resources held by the rwlock.
|
|
||||||
* rwlock can no longer be used after this call.
|
|
||||||
* rwlock is only destroyed when there are no longer any threads waiting on it.
|
|
||||||
* rwlock cannot be destroyed if it is locked.
|
|
||||||
* Parameters:
|
|
||||||
* ithread_rwlock_t * rwlock (must be valid non NULL pointer to pthread_rwlock_t)
|
|
||||||
* rwlock must be initialized.
|
|
||||||
* Returns:
|
|
||||||
* 0 on success. Nonzero on failure.
|
|
||||||
* Always returns 0.
|
|
||||||
* See man page for pthread_rwlock_destroy
|
|
||||||
*****************************************************************************/
|
|
||||||
#define ithread_rwlock_destroy pthread_rwlock_destroy
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ithread_cond_init
|
* Function: ithread_cond_init
|
||||||
*
|
*
|
||||||
|
@@ -30,8 +30,7 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "LinkedList.h"
|
#include "LinkedList.h"
|
||||||
#include <sys/param.h>
|
#ifdef __FreeBSD__
|
||||||
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
@@ -90,23 +90,20 @@ FreeThreadPoolJob( ThreadPool * tp,
|
|||||||
static int
|
static int
|
||||||
SetPolicyType( PolicyType in )
|
SetPolicyType( PolicyType in )
|
||||||
{
|
{
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
/* TODO not currently working... */
|
/* TODO not currently working... */
|
||||||
return 0;
|
return 0;
|
||||||
#elif defined(__OSX__)
|
#else
|
||||||
setpriority(PRIO_PROCESS, 0, 0);
|
#ifdef WIN32
|
||||||
return 0;
|
|
||||||
#elif defined(WIN32)
|
|
||||||
return sched_setscheduler( 0, in);
|
return sched_setscheduler( 0, in);
|
||||||
#elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
|
#else
|
||||||
struct sched_param current;
|
struct sched_param current;
|
||||||
|
|
||||||
sched_getparam( 0, ¤t );
|
sched_getparam( 0, ¤t );
|
||||||
current.sched_priority = DEFAULT_SCHED_PARAM;
|
current.sched_priority = DEFAULT_SCHED_PARAM;
|
||||||
return sched_setscheduler( 0, in, ¤t );
|
return sched_setscheduler( 0, in, ¤t );
|
||||||
#else
|
#endif
|
||||||
return 0;
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -126,7 +123,7 @@ SetPolicyType( PolicyType in )
|
|||||||
static int
|
static int
|
||||||
SetPriority( ThreadPriority priority )
|
SetPriority( ThreadPriority priority )
|
||||||
{
|
{
|
||||||
#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
|
|
||||||
int currentPolicy;
|
int currentPolicy;
|
||||||
int minPriority = 0;
|
int minPriority = 0;
|
||||||
int maxPriority = 0;
|
int maxPriority = 0;
|
||||||
@@ -158,9 +155,7 @@ SetPriority( ThreadPriority priority )
|
|||||||
|
|
||||||
return pthread_setschedparam( ithread_self(), currentPolicy,
|
return pthread_setschedparam( ithread_self(), currentPolicy,
|
||||||
&newPriority );
|
&newPriority );
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -359,25 +354,18 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
|
|||||||
* Parameters:
|
* Parameters:
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static void SetSeed() {
|
static void SetSeed() {
|
||||||
struct timeb t;
|
struct timeb t;
|
||||||
|
|
||||||
ftime( &t );
|
ftime( &t );
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id().p );
|
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id().p );
|
||||||
#elif defined(__FreeBSD__) || defined(__OSX__)
|
#elif defined(__FreeBSD__)
|
||||||
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id() );
|
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id() );
|
||||||
#elif defined(__linux__)
|
|
||||||
srand( ( unsigned int )t.millitm + ithread_get_current_thread_id() );
|
|
||||||
#else
|
#else
|
||||||
{
|
srand( ( unsigned int )t.millitm + ithread_get_current_thread_id() );
|
||||||
volatile union { volatile pthread_t tid; volatile unsigned i; } idu;
|
|
||||||
|
|
||||||
idu.tid = ithread_get_current_thread_id();
|
|
||||||
srand( ( unsigned int )t.millitm + idu.i );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: WorkerThread
|
* Function: WorkerThread
|
||||||
@@ -1511,33 +1499,36 @@ static void SetSeed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
void ThreadPoolPrintStats(ThreadPoolStats * stats)
|
void ThreadPoolPrintStats( ThreadPoolStats * stats ) {
|
||||||
{
|
assert( stats != NULL ); if( stats == NULL ) {
|
||||||
assert( stats != NULL );
|
return;}
|
||||||
if (stats == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
printf("ThreadPoolStats at Time: %d\n", time(NULL));
|
printf( "ThreadPoolStats at Time: %d\n", time( NULL ) );
|
||||||
#else /* __FreeBSD__ */
|
#else
|
||||||
printf("ThreadPoolStats at Time: %ld\n", time(NULL));
|
printf( "ThreadPoolStats at Time: %ld\n", time( NULL ) );
|
||||||
#endif /* __FreeBSD__ */
|
#endif
|
||||||
printf("High Jobs pending: %d\n", stats->currentJobsHQ);
|
printf
|
||||||
printf("Med Jobs Pending: %d\n", stats->currentJobsMQ);
|
( "Average Wait in High Priority Q in milliseconds: %f\n",
|
||||||
printf("Low Jobs Pending: %d\n", stats->currentJobsLQ);
|
stats->avgWaitHQ );
|
||||||
printf("Average Wait in High Priority Q in milliseconds: %f\n", stats->avgWaitHQ);
|
printf
|
||||||
printf("Average Wait in Med Priority Q in milliseconds: %f\n", stats->avgWaitMQ);
|
( "Average Wait in Med Priority Q in milliseconds: %f\n",
|
||||||
printf("Averate Wait in Low Priority Q in milliseconds: %f\n", stats->avgWaitLQ);
|
stats->avgWaitMQ );
|
||||||
printf("Max Threads Active: %d\n", stats->maxThreads);
|
printf
|
||||||
printf("Current Worker Threads: %d\n", stats->workerThreads);
|
( "Averate Wait in Low Priority Q in milliseconds: %f\n",
|
||||||
printf("Current Persistent Threads: %d\n", stats->persistentThreads);
|
stats->avgWaitLQ );
|
||||||
printf("Current Idle Threads: %d\n", stats->idleThreads);
|
printf( "Max Threads Active: %d\n", stats->maxThreads );
|
||||||
printf("Total Threads : %d\n", stats->totalThreads);
|
printf( "Current Worker Threads: %d\n",
|
||||||
printf("Total Time spent Working in seconds: %f\n", stats->totalWorkTime);
|
stats->workerThreads );
|
||||||
printf("Total Time spent Idle in seconds : %f\n", stats->totalIdleTime);
|
printf( "Current Persistent Threads: %d\n",
|
||||||
}
|
stats->persistentThreads );
|
||||||
#endif /* STATS */
|
printf( "Current Idle Threads: %d\n", stats->idleThreads );
|
||||||
|
printf( "Total Threads : %d\n", stats->totalThreads );
|
||||||
|
printf( "Total Time spent Working in seconds: %f\n",
|
||||||
|
stats->totalWorkTime );
|
||||||
|
printf( "Total Time spent Idle in seconds : %f\n",
|
||||||
|
stats->totalIdleTime );}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: TPAttrSetMaxJobsTotal
|
* Function: TPAttrSetMaxJobsTotal
|
||||||
@@ -1550,10 +1541,8 @@ void ThreadPoolPrintStats(ThreadPoolStats * stats)
|
|||||||
* Returns:
|
* Returns:
|
||||||
* Always returns 0.
|
* Always returns 0.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
int TPAttrSetMaxJobsTotal(
|
int TPAttrSetMaxJobsTotal( ThreadPoolAttr * attr,
|
||||||
ThreadPoolAttr * attr,
|
int maxJobsTotal ) {
|
||||||
int maxJobsTotal )
|
|
||||||
{
|
|
||||||
assert( attr != NULL );
|
assert( attr != NULL );
|
||||||
|
|
||||||
if( attr == NULL ) {
|
if( attr == NULL ) {
|
||||||
@@ -1562,7 +1551,7 @@ int TPAttrSetMaxJobsTotal(
|
|||||||
|
|
||||||
attr->maxJobsTotal = maxJobsTotal;
|
attr->maxJobsTotal = maxJobsTotal;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: ThreadPoolGetStats
|
* Function: ThreadPoolGetStats
|
||||||
@@ -1579,54 +1568,40 @@ int TPAttrSetMaxJobsTotal(
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
int
|
int
|
||||||
ThreadPoolGetStats(
|
ThreadPoolGetStats( ThreadPool * tp,
|
||||||
ThreadPool *tp,
|
ThreadPoolStats * stats ) {
|
||||||
ThreadPoolStats *stats)
|
|
||||||
{
|
|
||||||
assert(tp != NULL);
|
|
||||||
assert(stats != NULL);
|
|
||||||
|
|
||||||
if (tp == NULL || stats == NULL) {
|
assert( tp != NULL );
|
||||||
return EINVAL;
|
assert( stats != NULL );
|
||||||
}
|
if( ( tp == NULL ) || ( stats == NULL ) ) {
|
||||||
|
return EINVAL;}
|
||||||
|
|
||||||
//if not shutdown then acquire mutex
|
//if not shutdown then acquire mutex
|
||||||
if (!tp->shutdown) {
|
if( !tp->shutdown ) {
|
||||||
ithread_mutex_lock(&tp->mutex);
|
ithread_mutex_lock( &tp->mutex );}
|
||||||
}
|
|
||||||
|
|
||||||
*stats = tp->stats;
|
( *stats ) = tp->stats; if( stats->totalJobsHQ > 0 )
|
||||||
if (stats->totalJobsHQ > 0) {
|
stats->avgWaitHQ =
|
||||||
stats->avgWaitHQ = stats->totalTimeHQ / stats->totalJobsHQ;
|
stats->totalTimeHQ / stats->totalJobsHQ;
|
||||||
} else {
|
else
|
||||||
stats->avgWaitHQ = 0;
|
stats->avgWaitHQ = 0; if( stats->totalJobsMQ > 0 )
|
||||||
}
|
stats->avgWaitMQ =
|
||||||
|
stats->totalTimeMQ / stats->totalJobsMQ;
|
||||||
if( stats->totalJobsMQ > 0 ) {
|
else
|
||||||
stats->avgWaitMQ = stats->totalTimeMQ / stats->totalJobsMQ;
|
stats->avgWaitMQ = 0; if( stats->totalJobsLQ > 0 )
|
||||||
} else {
|
stats->avgWaitLQ =
|
||||||
stats->avgWaitMQ = 0;
|
stats->totalTimeLQ / stats->totalJobsLQ;
|
||||||
}
|
else
|
||||||
|
|
||||||
if( stats->totalJobsLQ > 0 ) {
|
|
||||||
stats->avgWaitLQ = stats->totalTimeLQ / stats->totalJobsLQ;
|
|
||||||
} else {
|
|
||||||
stats->avgWaitLQ = 0;
|
stats->avgWaitLQ = 0;
|
||||||
}
|
|
||||||
|
|
||||||
stats->totalThreads = tp->totalThreads;
|
stats->totalThreads = tp->totalThreads;
|
||||||
stats->persistentThreads = tp->persistentThreads;
|
stats->persistentThreads = tp->persistentThreads;
|
||||||
stats->currentJobsHQ = ListSize( &tp->highJobQ );
|
stats->currentJobsHQ = ListSize( &tp->highJobQ );
|
||||||
stats->currentJobsLQ = ListSize( &tp->lowJobQ );
|
stats->currentJobsLQ = ListSize( &tp->lowJobQ );
|
||||||
stats->currentJobsMQ = ListSize( &tp->medJobQ );
|
stats->currentJobsMQ = ListSize( &tp->medJobQ );
|
||||||
|
|
||||||
//if not shutdown then release mutex
|
//if not shutdown then release mutex
|
||||||
if( !tp->shutdown ) {
|
if( !tp->shutdown ) {
|
||||||
ithread_mutex_unlock( &tp->mutex );
|
ithread_mutex_unlock( &tp->mutex );}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* STATS */
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@@ -31,8 +31,7 @@
|
|||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/param.h>
|
#ifdef __FreeBSD__
|
||||||
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#else
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
# "Makefile.am" for "libupnp/upnp"
|
# "Makefile.am" for "libupnp/upnp"
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
|
|
||||||
SUBDIRS = doc . sample
|
SUBDIRS = doc . sample
|
||||||
@@ -22,14 +23,14 @@ LDADD = \
|
|||||||
|
|
||||||
|
|
||||||
upnpincludedir = $(includedir)/upnp
|
upnpincludedir = $(includedir)/upnp
|
||||||
upnpinclude_HEADERS = \
|
upnpinclude_HEADERS = inc/upnp.h
|
||||||
inc/upnp.h \
|
|
||||||
inc/upnpdebug.h
|
|
||||||
|
|
||||||
nodist_upnpinclude_HEADERS = inc/upnpconfig.h
|
nodist_upnpinclude_HEADERS = inc/upnpconfig.h
|
||||||
if ENABLE_TOOLS
|
if ENABLE_TOOLS
|
||||||
upnpinclude_HEADERS += inc/upnptools.h
|
upnpinclude_HEADERS += inc/upnptools.h
|
||||||
endif
|
endif
|
||||||
|
if ENABLE_DEBUG
|
||||||
|
upnpinclude_HEADERS += inc/upnpdebug.h
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libupnp.la
|
lib_LTLIBRARIES = libupnp.la
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# "Makefile.am" for "libunp/upnp/doc"
|
# "Makefile.am" for "libunp/upnp/doc"
|
||||||
#
|
#
|
||||||
# (C) Copyright 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
# (C) Copyright 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
##########################################################################
|
##########################################################################
|
||||||
#
|
#
|
||||||
|
Binary file not shown.
@@ -47,8 +47,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/param.h>
|
#ifdef __FreeBSD__
|
||||||
#if (defined(BSD) && BSD >= 199306)
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
#include "ixml.h"
|
#include "ixml.h"
|
||||||
@@ -829,10 +828,13 @@ struct Upnp_Event
|
|||||||
* Upnp_Discovery structure correctly.
|
* Upnp_Discovery structure correctly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
typedef struct sockaddr_in SOCKADDRIN;
|
||||||
|
|
||||||
/** Returned in a {\bf UPNP_DISCOVERY_RESULT} callback. */
|
/** Returned in a {\bf UPNP_DISCOVERY_RESULT} callback. */
|
||||||
|
|
||||||
struct Upnp_Discovery
|
struct Upnp_Discovery
|
||||||
{
|
{
|
||||||
|
|
||||||
/** The result code of the {\bf UpnpSearchAsync} call. */
|
/** The result code of the {\bf UpnpSearchAsync} call. */
|
||||||
int ErrCode;
|
int ErrCode;
|
||||||
|
|
||||||
@@ -864,7 +866,8 @@ struct Upnp_Discovery
|
|||||||
char Ext[LINE_SIZE];
|
char Ext[LINE_SIZE];
|
||||||
|
|
||||||
/** The host address of the device responding to the search. */
|
/** The host address of the device responding to the search. */
|
||||||
struct sockaddr_in DestAddr;
|
SOCKADDRIN * DestAddr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or {\bf
|
/** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or {\bf
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/* -*- C -*- */
|
/* -*- C -*- */
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2000-2003 Intel Corporation
|
* Copyright (c) 2000-2003 Intel Corporation
|
||||||
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -246,19 +246,15 @@ static UPNP_INLINE int DebugAtThisLevel(
|
|||||||
* Returns: void
|
* Returns: void
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void UpnpPrintf(
|
void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
|
||||||
Upnp_LogLevel DLevel,
|
const char* DbgFileName, int DbgLineNo,
|
||||||
Dbg_Module Module,
|
|
||||||
const char* DbgFileName,
|
|
||||||
int DbgLineNo,
|
|
||||||
const char* FmtStr,
|
const char* FmtStr,
|
||||||
...)
|
...)
|
||||||
#if (__GNUC__ >= 3)
|
#if (__GNUC__ >= 3)
|
||||||
/* This enables printf like format checking by the compiler */
|
|
||||||
__attribute__((format (__printf__, 5, 6)))
|
__attribute__((format (__printf__, 5, 6)))
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
#else /* DEBUG */
|
#else
|
||||||
static UPNP_INLINE void UpnpPrintf(
|
static UPNP_INLINE void UpnpPrintf(
|
||||||
Upnp_LogLevel DLevel,
|
Upnp_LogLevel DLevel,
|
||||||
Dbg_Module Module,
|
Dbg_Module Module,
|
||||||
@@ -266,7 +262,7 @@ static UPNP_INLINE void UpnpPrintf(
|
|||||||
int DbgLineNo,
|
int DbgLineNo,
|
||||||
const char* FmtStr,
|
const char* FmtStr,
|
||||||
...) {}
|
...) {}
|
||||||
#endif /* DEBUG */
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@@ -79,9 +79,8 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
web/tvcombodesc.xml \
|
tvdevice/web/tvcontrolSCPD.xml \
|
||||||
web/tvcontrolSCPD.xml \
|
tvdevice/web/tvdevicedesc.xml \
|
||||||
web/tvdevicedesc.xml \
|
tvdevice/web/tvdevicepres.html \
|
||||||
web/tvdevicepres.html \
|
tvdevice/web/tvpictureSCPD.xml
|
||||||
web/tvpictureSCPD.xml
|
|
||||||
|
|
||||||
|
@@ -1362,7 +1362,7 @@ TvCtrlPointStart( print_string printFunctionPtr,
|
|||||||
|
|
||||||
ithread_mutex_init( &DeviceListMutex, 0 );
|
ithread_mutex_init( &DeviceListMutex, 0 );
|
||||||
|
|
||||||
SampleUtil_Print( "Initializing UPnP with ipaddress=%s port=%d",
|
SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d",
|
||||||
ip_address, port );
|
ip_address, port );
|
||||||
rc = UpnpInit( ip_address, port );
|
rc = UpnpInit( ip_address, port );
|
||||||
if( UPNP_E_SUCCESS != rc ) {
|
if( UPNP_E_SUCCESS != rc ) {
|
||||||
|
@@ -37,7 +37,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
@@ -54,11 +53,6 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#if (defined(BSD) && BSD >= 199306)
|
|
||||||
#include <ifaddrs.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#include "upnpapi.h"
|
#include "upnpapi.h"
|
||||||
#include "httpreadwrite.h"
|
#include "httpreadwrite.h"
|
||||||
@@ -79,13 +73,11 @@
|
|||||||
#include "urlconfig.h"
|
#include "urlconfig.h"
|
||||||
#endif // INTERNAL_WEB_SERVER
|
#endif // INTERNAL_WEB_SERVER
|
||||||
|
|
||||||
virtualDirList *pVirtualDirList;
|
|
||||||
|
|
||||||
// Mutex to synchronize the subscription handling at the client side
|
// Mutex to synchronize the subscription handling at the client side
|
||||||
CLIENTONLY( ithread_mutex_t GlobalClientSubscribeMutex; )
|
CLIENTONLY( ithread_mutex_t GlobalClientSubscribeMutex; )
|
||||||
|
|
||||||
// rwlock to synchronize handles (root device or control point handle)
|
//Mutex to synchronize handles ( root device or control point handle)
|
||||||
ithread_rwlock_t GlobalHndRWLock;
|
ithread_mutex_t GlobalHndMutex;
|
||||||
|
|
||||||
// Mutex to synchronize the uuid creation process
|
// Mutex to synchronize the uuid creation process
|
||||||
ithread_mutex_t gUUIDMutex;
|
ithread_mutex_t gUUIDMutex;
|
||||||
@@ -213,26 +205,26 @@ int UpnpInit( IN const char *HostIP,
|
|||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
/* On Cygwin, pthread_mutex_init() fails without this memset. */
|
/* On Cygwin, pthread_mutex_init() fails without this memset. */
|
||||||
/* TODO: Fix Cygwin so we don't need this memset(). */
|
/* TODO: Fix Cygwin so we don't need this memset(). */
|
||||||
memset(&GlobalHndRWLock, 0, sizeof(GlobalHndRWLock));
|
memset(&GlobalHndMutex, 0, sizeof(GlobalHndMutex));
|
||||||
#endif
|
#endif
|
||||||
if (ithread_rwlock_init(&GlobalHndRWLock, NULL) != 0) {
|
if( ithread_mutex_init( &GlobalHndMutex, NULL ) != 0 ) {
|
||||||
return UPNP_E_INIT_FAILED;
|
return UPNP_E_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ithread_mutex_init(&gUUIDMutex, NULL) != 0) {
|
if( ithread_mutex_init( &gUUIDMutex, NULL ) != 0 ) {
|
||||||
return UPNP_E_INIT_FAILED;
|
return UPNP_E_INIT_FAILED;
|
||||||
}
|
}
|
||||||
// initialize subscribe mutex
|
// initialize subscribe mutex
|
||||||
#ifdef INCLUDE_CLIENT_APIS
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
if (ithread_mutex_init(&GlobalClientSubscribeMutex, NULL) != 0) {
|
if ( ithread_mutex_init( &GlobalClientSubscribeMutex, NULL ) != 0 ) {
|
||||||
return UPNP_E_INIT_FAILED;
|
return UPNP_E_INIT_FAILED;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HandleLock();
|
HandleLock();
|
||||||
if( HostIP != NULL ) {
|
if( HostIP != NULL )
|
||||||
strcpy( LOCAL_HOST, HostIP );
|
strcpy( LOCAL_HOST, HostIP );
|
||||||
} else {
|
else {
|
||||||
if( getlocalhostname( LOCAL_HOST ) != UPNP_E_SUCCESS ) {
|
if( getlocalhostname( LOCAL_HOST ) != UPNP_E_SUCCESS ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INIT_FAILED;
|
return UPNP_E_INIT_FAILED;
|
||||||
@@ -323,54 +315,27 @@ int UpnpInit( IN const char *HostIP,
|
|||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static void
|
static void
|
||||||
PrintThreadPoolStats(
|
PrintThreadPoolStats (const char* DbgFileName, int DbgLineNo,
|
||||||
ThreadPool *tp,
|
const char* msg, const ThreadPoolStats* const stats)
|
||||||
const char *DbgFileName,
|
|
||||||
int DbgLineNo,
|
|
||||||
const char *msg)
|
|
||||||
{
|
{
|
||||||
ThreadPoolStats stats;
|
UpnpPrintf (UPNP_INFO, API, DbgFileName, DbgLineNo,
|
||||||
ThreadPoolGetStats(tp, &stats);
|
"%s \n High Jobs pending = %d \nMed Jobs Pending = %d\n"
|
||||||
UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo,
|
" Low Jobs Pending = %d \nWorker Threads = %d\n"
|
||||||
"%s \n"
|
"Idle Threads = %d\nPersistent Threads = %d\n"
|
||||||
"High Jobs pending: %d\n"
|
"Average Time spent in High Q = %lf\n"
|
||||||
"Med Jobs Pending: %d\n"
|
"Average Time spent in Med Q = %lf\n"
|
||||||
"Low Jobs Pending: %d\n"
|
"Average Time spent in Low Q = %lf\n"
|
||||||
"Average wait in High Q in milliseconds: %lf\n"
|
"Max Threads Used: %d\nTotal Work Time= %lf\n"
|
||||||
"Average wait in Med Q in milliseconds: %lf\n"
|
"Total Idle Time = %lf\n",
|
||||||
"Average wait in Low Q in milliseconds: %lf\n"
|
|
||||||
"Max Threads Used: %d\n"
|
|
||||||
"Worker Threads: %d\n"
|
|
||||||
"Persistent Threads: %d\n"
|
|
||||||
"Idle Threads: %d\n"
|
|
||||||
"Total Threads: %d\n"
|
|
||||||
"Total Work Time: %lf\n"
|
|
||||||
"Total Idle Time: %lf\n",
|
|
||||||
msg,
|
msg,
|
||||||
stats.currentJobsHQ,
|
stats->currentJobsHQ, stats->currentJobsMQ,
|
||||||
stats.currentJobsMQ,
|
stats->currentJobsLQ, stats->workerThreads,
|
||||||
stats.currentJobsLQ,
|
stats->idleThreads, stats->persistentThreads,
|
||||||
stats.avgWaitHQ,
|
stats->avgWaitHQ, stats->avgWaitMQ, stats->avgWaitLQ,
|
||||||
stats.avgWaitMQ,
|
stats->maxThreads, stats->totalWorkTime,
|
||||||
stats.avgWaitLQ,
|
stats->totalIdleTime );
|
||||||
stats.maxThreads,
|
|
||||||
stats.workerThreads,
|
|
||||||
stats.persistentThreads,
|
|
||||||
stats.idleThreads,
|
|
||||||
stats.totalThreads,
|
|
||||||
stats.totalWorkTime,
|
|
||||||
stats.totalIdleTime);
|
|
||||||
}
|
}
|
||||||
#else /* DEBUG */
|
#endif
|
||||||
static UPNP_INLINE void
|
|
||||||
PrintThreadPoolStats(
|
|
||||||
ThreadPool *tp,
|
|
||||||
const char *DbgFileName,
|
|
||||||
int DbgLineNo,
|
|
||||||
const char *msg)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif /* DEBUG */
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -401,6 +366,10 @@ UpnpFinish()
|
|||||||
#endif
|
#endif
|
||||||
struct Handle_Info *temp;
|
struct Handle_Info *temp;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
ThreadPoolStats stats;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// WSACleanup( );
|
// WSACleanup( );
|
||||||
#endif
|
#endif
|
||||||
@@ -412,12 +381,18 @@ UpnpFinish()
|
|||||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpFinish : UpnpSdkInit is :%d:\n",
|
"Inside UpnpFinish : UpnpSdkInit is :%d:\n",
|
||||||
UpnpSdkInit );
|
UpnpSdkInit );
|
||||||
|
#ifdef DEBUG
|
||||||
if( UpnpSdkInit == 1 ) {
|
if( UpnpSdkInit == 1 ) {
|
||||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||||
"UpnpFinish : UpnpSdkInit is ONE\n" );
|
"UpnpFinish : UpnpSdkInit is ONE\n" );
|
||||||
}
|
}
|
||||||
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
|
ThreadPoolGetStats( &gRecvThreadPool, &stats );
|
||||||
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
|
PrintThreadPoolStats (__FILE__, __LINE__,
|
||||||
|
"Recv Thread Pool", &stats);
|
||||||
|
ThreadPoolGetStats( &gSendThreadPool, &stats );
|
||||||
|
PrintThreadPoolStats (__FILE__, __LINE__,
|
||||||
|
"Send Thread Pool", &stats);
|
||||||
|
#endif
|
||||||
#ifdef INCLUDE_DEVICE_APIS
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
if( GetDeviceHandleInfo( &device_handle, &temp ) == HND_DEVICE )
|
if( GetDeviceHandleInfo( &device_handle, &temp ) == HND_DEVICE )
|
||||||
UpnpUnRegisterRootDevice( device_handle );
|
UpnpUnRegisterRootDevice( device_handle );
|
||||||
@@ -436,38 +411,44 @@ UpnpFinish()
|
|||||||
web_server_destroy();
|
web_server_destroy();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ThreadPoolShutdown(&gSendThreadPool);
|
#ifdef DEBUG
|
||||||
ThreadPoolShutdown(&gRecvThreadPool);
|
ThreadPoolShutdown( &gSendThreadPool );
|
||||||
|
ThreadPoolShutdown( &gRecvThreadPool );
|
||||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||||
"Exiting UpnpFinish : UpnpSdkInit is :%d:\n", UpnpSdkInit);
|
"Exiting UpnpFinish : UpnpSdkInit is :%d:\n",
|
||||||
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
|
UpnpSdkInit );
|
||||||
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
|
ThreadPoolGetStats( &gRecvThreadPool, &stats );
|
||||||
|
PrintThreadPoolStats( __FILE__, __LINE__,
|
||||||
|
"Recv Thread Pool", &stats);
|
||||||
|
ThreadPoolGetStats( &gSendThreadPool, &stats );
|
||||||
|
PrintThreadPoolStats(__FILE__, __LINE__,
|
||||||
|
"Send Thread Pool", &stats);
|
||||||
UpnpCloseLog();
|
UpnpCloseLog();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef INCLUDE_CLIENT_APIS
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
ithread_mutex_destroy(&GlobalClientSubscribeMutex);
|
ithread_mutex_destroy( &GlobalClientSubscribeMutex );
|
||||||
#endif
|
#endif
|
||||||
ithread_rwlock_destroy(&GlobalHndRWLock);
|
ithread_mutex_destroy( &GlobalHndMutex );
|
||||||
ithread_mutex_destroy(&gUUIDMutex);
|
ithread_mutex_destroy( &gUUIDMutex );
|
||||||
|
|
||||||
// remove all virtual dirs
|
// remove all virtual dirs
|
||||||
UpnpRemoveAllVirtualDirs();
|
UpnpRemoveAllVirtualDirs();
|
||||||
|
// leuk_he allow static linking:
|
||||||
// allow static linking
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifdef PTW32_STATIC_LIB
|
#ifdef PTW32_STATIC_LIB
|
||||||
pthread_win32_thread_detach_np ();
|
pthread_win32_thread_detach_np ();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
UpnpSdkInit = 0;
|
UpnpSdkInit = 0;
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
|
|
||||||
}
|
} /********************* End of UpnpFinish *************************/
|
||||||
/*************************** End of UpnpFinish *****************************/
|
|
||||||
|
|
||||||
/******************************************************************************
|
/****************************************************************************
|
||||||
* Function: UpnpGetServerPort
|
* Function: UpnpGetServerPort
|
||||||
*
|
*
|
||||||
* Parameters: NONE
|
* Parameters: NONE
|
||||||
@@ -964,7 +945,7 @@ GetDescDocumentAndURL( IN Upnp_DescType descriptionType,
|
|||||||
char *temp_str = NULL;
|
char *temp_str = NULL;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
off_t fileLen;
|
off_t fileLen;
|
||||||
size_t num_read;
|
unsigned num_read;
|
||||||
time_t last_modified;
|
time_t last_modified;
|
||||||
struct stat file_info;
|
struct stat file_info;
|
||||||
struct sockaddr_in serverAddr;
|
struct sockaddr_in serverAddr;
|
||||||
@@ -1570,7 +1551,7 @@ UpnpSearchAsync( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpSearchAsync \n" );
|
"Inside UpnpSearchAsync \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -1746,7 +1727,7 @@ UpnpSubscribeAsync( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpSubscribeAsync \n" );
|
"Inside UpnpSubscribeAsync \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -1763,13 +1744,15 @@ UpnpSubscribeAsync( IN UpnpClient_Handle Hnd,
|
|||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_PARAM;
|
return UPNP_E_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
HandleUnlock();
|
|
||||||
|
|
||||||
Param = (struct UpnpNonblockParam *)
|
Param =
|
||||||
malloc(sizeof (struct UpnpNonblockParam));
|
( struct UpnpNonblockParam * )
|
||||||
|
malloc( sizeof( struct UpnpNonblockParam ) );
|
||||||
if( Param == NULL ) {
|
if( Param == NULL ) {
|
||||||
|
HandleUnlock();
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
}
|
}
|
||||||
|
HandleUnlock();
|
||||||
|
|
||||||
Param->FunName = SUBSCRIBE;
|
Param->FunName = SUBSCRIBE;
|
||||||
Param->Handle = Hnd;
|
Param->Handle = Hnd;
|
||||||
@@ -1829,7 +1812,7 @@ UpnpSubscribe( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpSubscribe \n" );
|
"Inside UpnpSubscribe \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -1889,7 +1872,7 @@ UpnpUnSubscribe( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpUnSubscribe \n" );
|
"Inside UpnpUnSubscribe \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -1948,7 +1931,7 @@ UpnpUnSubscribeAsync( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpUnSubscribeAsync \n" );
|
"Inside UpnpUnSubscribeAsync \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2022,7 +2005,7 @@ UpnpRenewSubscription( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpRenewSubscription \n" );
|
"Inside UpnpRenewSubscription \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2087,7 +2070,7 @@ UpnpRenewSubscriptionAsync( IN UpnpClient_Handle Hnd,
|
|||||||
|
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpRenewSubscriptionAsync \n" );
|
"Inside UpnpRenewSubscriptionAsync \n" );
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2182,7 +2165,7 @@ UpnpNotify( IN UpnpDevice_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpNotify \n" );
|
"Inside UpnpNotify \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2253,7 +2236,7 @@ UpnpNotifyExt( IN UpnpDevice_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpNotify \n" );
|
"Inside UpnpNotify \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2330,7 +2313,7 @@ UpnpAcceptSubscription( IN UpnpDevice_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpAcceptSubscription \n" );
|
"Inside UpnpAcceptSubscription \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2406,7 +2389,7 @@ UpnpAcceptSubscriptionExt( IN UpnpDevice_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpAcceptSubscription \n" );
|
"Inside UpnpAcceptSubscription \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2502,7 +2485,7 @@ UpnpSendAction( IN UpnpClient_Handle Hnd,
|
|||||||
}
|
}
|
||||||
DevUDN_const = NULL;
|
DevUDN_const = NULL;
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2586,7 +2569,7 @@ UpnpSendActionEx( IN UpnpClient_Handle Hnd,
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2662,7 +2645,7 @@ UpnpSendActionAsync( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpSendActionAsync \n" );
|
"Inside UpnpSendActionAsync \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2782,7 +2765,7 @@ UpnpSendActionExAsync( IN UpnpClient_Handle Hnd,
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2896,7 +2879,7 @@ UpnpGetServiceVarStatusAsync( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpGetServiceVarStatusAsync \n" );
|
"Inside UpnpGetServiceVarStatusAsync \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -2976,7 +2959,7 @@ UpnpGetServiceVarStatus( IN UpnpClient_Handle Hnd,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Inside UpnpGetServiceVarStatus \n" );
|
"Inside UpnpGetServiceVarStatus \n" );
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -3305,13 +3288,15 @@ UpnpDownloadXmlDoc( const char *url,
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
xml_buf = ixmlPrintNode( ( IXML_Node * ) * xmlDoc );
|
xml_buf = ixmlPrintNode( ( IXML_Node * ) * xmlDoc );
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Printing the Parsed xml document \n %s\n", xml_buf );
|
"Printing the Parsed xml document \n %s\n",
|
||||||
|
xml_buf );
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"****************** END OF Parsed XML Doc *****************\n" );
|
"****************** END OF Parsed XML Doc *****************\n" );
|
||||||
ixmlFreeDOMString( xml_buf );
|
ixmlFreeDOMString( xml_buf );
|
||||||
#endif
|
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Exiting UpnpDownloadXmlDoc\n" );
|
"Exiting UpnpDownloadXmlDoc\n" );
|
||||||
|
#endif
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3644,6 +3629,7 @@ int PrintHandleInfo( IN UpnpClient_Handle Hnd )
|
|||||||
struct Handle_Info * HndInfo;
|
struct Handle_Info * HndInfo;
|
||||||
if (HandleTable[Hnd] != NULL) {
|
if (HandleTable[Hnd] != NULL) {
|
||||||
HndInfo = HandleTable[Hnd];
|
HndInfo = HandleTable[Hnd];
|
||||||
|
#ifdef DEBUG
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Printing information for Handle_%d\n", Hnd);
|
"Printing information for Handle_%d\n", Hnd);
|
||||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
@@ -3652,6 +3638,7 @@ int PrintHandleInfo( IN UpnpClient_Handle Hnd )
|
|||||||
if(HndInfo->HType != HND_CLIENT)
|
if(HndInfo->HType != HND_CLIENT)
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"DescURL_%s\n", HndInfo->DescURL );
|
"DescURL_%s\n", HndInfo->DescURL );
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
@@ -3730,44 +3717,8 @@ void printNodes( IXML_Node * tmpRoot, int depth )
|
|||||||
strcpy( out, inet_ntoa(LocalAddr.sin_addr));
|
strcpy( out, inet_ntoa(LocalAddr.sin_addr));
|
||||||
}
|
}
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
#elif (defined(BSD) && BSD >= 199306)
|
|
||||||
struct ifaddrs *ifap, *ifa;
|
|
||||||
|
|
||||||
if (getifaddrs(&ifap) != 0) {
|
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
|
||||||
"DiscoverInterfaces: getifaddrs() returned error\n" );
|
|
||||||
return UPNP_E_INIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
// cycle through available interfaces
|
|
||||||
for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
|
|
||||||
// Skip loopback, point-to-point and down interfaces,
|
|
||||||
// except don't skip down interfaces
|
|
||||||
// if we're trying to get a list of configurable interfaces.
|
|
||||||
if( ( ifa->ifa_flags & IFF_LOOPBACK )
|
|
||||||
|| ( !( ifa->ifa_flags & IFF_UP ) ) ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if( ifa->ifa_addr->sa_family == AF_INET ) {
|
|
||||||
// We don't want the loopback interface.
|
|
||||||
if( ((struct sockaddr_in *)(ifa->ifa_addr))->sin_addr.s_addr ==
|
|
||||||
htonl( INADDR_LOOPBACK ) ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
strncpy( out, inet_ntoa( ((struct sockaddr_in *)(ifa->ifa_addr))->
|
|
||||||
sin_addr ), LINE_SIZE );
|
|
||||||
out[LINE_SIZE-1] = '\0';
|
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
|
||||||
"Inside getlocalhostname : after strncpy %s\n",
|
|
||||||
out );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
freeifaddrs(ifap);
|
|
||||||
|
|
||||||
return ifa ? UPNP_E_SUCCESS : UPNP_E_INIT;
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
char szBuffer[MAX_INTERFACES * sizeof( struct ifreq )];
|
char szBuffer[MAX_INTERFACES * sizeof( struct ifreq )];
|
||||||
struct ifconf ifConf;
|
struct ifconf ifConf;
|
||||||
struct ifreq ifReq;
|
struct ifreq ifReq;
|
||||||
|
@@ -173,7 +173,7 @@ int DebugAtThisLevel(
|
|||||||
IN Upnp_LogLevel DLevel,
|
IN Upnp_LogLevel DLevel,
|
||||||
IN Dbg_Module Module)
|
IN Dbg_Module Module)
|
||||||
{
|
{
|
||||||
int ret = DLevel <= g_log_level;
|
int ret = g_log_level >= DLevel;
|
||||||
ret &=
|
ret &=
|
||||||
DEBUG_ALL ||
|
DEBUG_ALL ||
|
||||||
(Module == SSDP && DEBUG_SSDP ) ||
|
(Module == SSDP && DEBUG_SSDP ) ||
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
#define HEADER_LENGTH 2000
|
#define HEADER_LENGTH 2000
|
||||||
|
|
||||||
// Structure to maintain a error code and string associated with the
|
//Structure to maintain a error code and string associated with the
|
||||||
// error code
|
// error code
|
||||||
struct ErrorString {
|
struct ErrorString {
|
||||||
int rc; /* error code */
|
int rc; /* error code */
|
||||||
@@ -44,7 +44,7 @@ struct ErrorString {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initializing the array of error structures.
|
//Intializing the array of error structures.
|
||||||
struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
|
struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
|
||||||
{UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
|
{UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
|
||||||
{UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
|
{UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
|
||||||
@@ -581,5 +581,4 @@ UpnpCreatePropertySet( IN int NumArg,
|
|||||||
return PropSet;
|
return PropSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EXCLUDE_DOM == 0
|
#endif
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ GenaAutoRenewSubscription( IN void *input )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( send_callback ) {
|
if( send_callback ) {
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
free_upnp_timeout( event );
|
free_upnp_timeout( event );
|
||||||
@@ -543,10 +543,10 @@ genaSubscribe( IN UpnpClient_Handle client_handle,
|
|||||||
|
|
||||||
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
|
||||||
"GENA SUBSCRIBE BEGIN" );
|
"GENA SUBSCRIBE BEGIN" );
|
||||||
|
HandleLock();
|
||||||
|
|
||||||
memset( out_sid, 0, sizeof( Upnp_SID ) );
|
memset( out_sid, 0, sizeof( Upnp_SID ) );
|
||||||
|
|
||||||
HandleReadLock();
|
|
||||||
// validate handle
|
// validate handle
|
||||||
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
@@ -881,4 +881,3 @@ gena_process_notification_event( IN SOCKINFO * info,
|
|||||||
|
|
||||||
#endif // INCLUDE_CLIENT_APIS
|
#endif // INCLUDE_CLIENT_APIS
|
||||||
#endif // EXCLUDE_GENA
|
#endif // EXCLUDE_GENA
|
||||||
|
|
||||||
|
@@ -365,7 +365,7 @@ genaNotifyThread( IN void *input )
|
|||||||
struct Handle_Info *handle_info;
|
struct Handle_Info *handle_info;
|
||||||
ThreadPoolJob job;
|
ThreadPoolJob job;
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
//validate context
|
//validate context
|
||||||
|
|
||||||
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {
|
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {
|
||||||
|
@@ -396,7 +396,7 @@ scanner_get_str( IN scanner_t * scanner )
|
|||||||
* Note :
|
* Note :
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
#warning The only use of the function 'scanner_pushback()' in the code is commented out.
|
#warning The only use of the function 'scanner_pushback()' in the code is commented out.
|
||||||
#warning 'scanner_pushback()' is a candidate for removal.
|
#warning 'scanner_pushback()' is a good candidate for removal.
|
||||||
static UPNP_INLINE void
|
static UPNP_INLINE void
|
||||||
scanner_pushback( INOUT scanner_t * scanner,
|
scanner_pushback( INOUT scanner_t * scanner,
|
||||||
IN size_t pushback_bytes )
|
IN size_t pushback_bytes )
|
||||||
@@ -966,7 +966,7 @@ read_until_crlf( INOUT scanner_t * scanner,
|
|||||||
* PARSE_INCOMPLETE
|
* PARSE_INCOMPLETE
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code.
|
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code.
|
||||||
#warning 'skip_to_end_of_header()' is a candidate for removal.
|
#warning 'skip_to_end_of_header()' is a good candidate for removal.
|
||||||
static UPNP_INLINE int
|
static UPNP_INLINE int
|
||||||
skip_to_end_of_header( INOUT scanner_t * scanner )
|
skip_to_end_of_header( INOUT scanner_t * scanner )
|
||||||
{
|
{
|
||||||
|
@@ -349,7 +349,7 @@ http_SendMessage( IN SOCKINFO * info,
|
|||||||
filename = ( char * )va_arg( argp, char * );
|
filename = ( char * )va_arg( argp, char * );
|
||||||
|
|
||||||
if( Instr && Instr->IsVirtualFile )
|
if( Instr && Instr->IsVirtualFile )
|
||||||
Fp = (virtualDirCallback.open)( filename, UPNP_READ );
|
Fp = virtualDirCallback.open( filename, UPNP_READ );
|
||||||
else
|
else
|
||||||
Fp = fopen( filename, "rb" );
|
Fp = fopen( filename, "rb" );
|
||||||
|
|
||||||
@@ -475,13 +475,11 @@ http_SendMessage( IN SOCKINFO * info,
|
|||||||
buf_length = ( size_t ) va_arg( argp, size_t );
|
buf_length = ( size_t ) va_arg( argp, size_t );
|
||||||
if( buf_length > 0 ) {
|
if( buf_length > 0 ) {
|
||||||
num_written = sock_write( info, buf, buf_length, TimeOut );
|
num_written = sock_write( info, buf, buf_length, TimeOut );
|
||||||
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
|
||||||
">>> (SENT) >>>\n"
|
|
||||||
"%.*s\nbuf_length=%d, num_written=%d\n"
|
|
||||||
"------------\n",
|
|
||||||
(int)buf_length, buf, (int)buf_length, num_written );
|
|
||||||
if( ( size_t ) num_written != buf_length )
|
if( ( size_t ) num_written != buf_length )
|
||||||
goto end;
|
goto end;
|
||||||
|
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
|
||||||
|
">>> (SENT) >>>\n%.*s\n------------\n",
|
||||||
|
( int )buf_length, buf );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -880,24 +880,22 @@ GetNextRange( char **SrcRangeStr,
|
|||||||
off_t *FirstByte,
|
off_t *FirstByte,
|
||||||
off_t *LastByte )
|
off_t *LastByte )
|
||||||
{
|
{
|
||||||
char *Ptr;
|
char *Ptr,
|
||||||
char *Tok;
|
*Tok;
|
||||||
int i;
|
int i,
|
||||||
int64_t F = -1;
|
F = -1,
|
||||||
int64_t L = -1;
|
L = -1;
|
||||||
int Is_Suffix_byte_Range = 1;
|
int Is_Suffix_byte_Range = 1;
|
||||||
|
|
||||||
if( *SrcRangeStr == NULL ) {
|
if( *SrcRangeStr == NULL )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
Tok = StrTok( SrcRangeStr, "," );
|
Tok = StrTok( SrcRangeStr, "," );
|
||||||
|
|
||||||
if( ( Ptr = strstr( Tok, "-" ) ) == NULL ) {
|
if( ( Ptr = strstr( Tok, "-" ) ) == NULL )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
*Ptr = ' ';
|
*Ptr = ' ';
|
||||||
sscanf( Tok, "%"SCNd64"%"SCNd64, &F, &L );
|
sscanf( Tok, "%d%d", &F, &L );
|
||||||
|
|
||||||
if( F == -1 || L == -1 ) {
|
if( F == -1 || L == -1 ) {
|
||||||
*Ptr = '-';
|
*Ptr = '-';
|
||||||
@@ -912,15 +910,16 @@ GetNextRange( char **SrcRangeStr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( Is_Suffix_byte_Range ) {
|
if( Is_Suffix_byte_Range ) {
|
||||||
*FirstByte = (off_t)L;
|
*FirstByte = L;
|
||||||
*LastByte = (off_t)F;
|
*LastByte = F;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*FirstByte = (off_t)F;
|
|
||||||
*LastByte = (off_t)L;
|
|
||||||
|
|
||||||
|
*FirstByte = F;
|
||||||
|
*LastByte = L;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -1532,7 +1531,7 @@ http_RecvPostMessage( http_parser_t * parser,
|
|||||||
|
|
||||||
if( Instr && Instr->IsVirtualFile ) {
|
if( Instr && Instr->IsVirtualFile ) {
|
||||||
|
|
||||||
Fp = (virtualDirCallback.open)( filename, UPNP_WRITE );
|
Fp = virtualDirCallback.open( filename, UPNP_WRITE );
|
||||||
if( Fp == NULL ) {
|
if( Fp == NULL ) {
|
||||||
return HTTP_INTERNAL_SERVER_ERROR;
|
return HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
@@ -231,15 +231,6 @@ sock_read_write( IN SOCKINFO * info,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SO_NOSIGPIPE
|
|
||||||
{
|
|
||||||
int old;
|
|
||||||
int set = 1;
|
|
||||||
socklen_t olen = sizeof(old);
|
|
||||||
getsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, &olen);
|
|
||||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof(set));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( bRead ) {
|
if( bRead ) {
|
||||||
// read data
|
// read data
|
||||||
numBytes = recv( sockfd, buffer, bufsize,MSG_NOSIGNAL);
|
numBytes = recv( sockfd, buffer, bufsize,MSG_NOSIGNAL);
|
||||||
@@ -252,9 +243,6 @@ sock_read_write( IN SOCKINFO * info,
|
|||||||
send( sockfd, buffer + bytes_sent, byte_left,
|
send( sockfd, buffer + bytes_sent, byte_left,
|
||||||
MSG_DONTROUTE|MSG_NOSIGNAL);
|
MSG_DONTROUTE|MSG_NOSIGNAL);
|
||||||
if( num_written == -1 ) {
|
if( num_written == -1 ) {
|
||||||
#ifdef SO_NOSIGPIPE
|
|
||||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, olen);
|
|
||||||
#endif
|
|
||||||
return num_written;
|
return num_written;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,11 +253,6 @@ sock_read_write( IN SOCKINFO * info,
|
|||||||
numBytes = bytes_sent;
|
numBytes = bytes_sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SO_NOSIGPIPE
|
|
||||||
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, olen);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if( numBytes < 0 ) {
|
if( numBytes < 0 ) {
|
||||||
return UPNP_E_SOCKET_ERROR;
|
return UPNP_E_SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
@@ -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__)
|
#ifndef WIN32
|
||||||
char temp_hostbyname_buff[BUFFER_SIZE];
|
char temp_hostbyname_buff[BUFFER_SIZE];
|
||||||
struct hostent h_buf;
|
struct hostent h_buf;
|
||||||
#endif
|
#endif
|
||||||
@@ -626,61 +626,27 @@ parse_hostport( const char *in,
|
|||||||
// TODO: Use autoconf to discover this rather than the
|
// TODO: Use autoconf to discover this rather than the
|
||||||
// platform-specific stuff below
|
// platform-specific stuff below
|
||||||
#if defined(WIN32) || defined(__CYGWIN__)
|
#if defined(WIN32) || defined(__CYGWIN__)
|
||||||
h = gethostbyname(temp_host_name);
|
h=gethostbyname(temp_host_name);
|
||||||
#elif defined(SPARC_SOLARIS)
|
#elif defined(SPARC_SOLARIS)
|
||||||
errCode = gethostbyname_r(
|
errCode = gethostbyname_r( temp_host_name,
|
||||||
temp_host_name,
|
|
||||||
&h,
|
&h,
|
||||||
temp_hostbyname_buff,
|
temp_hostbyname_buff,
|
||||||
BUFFER_SIZE, &errcode );
|
BUFFER_SIZE, &errcode );
|
||||||
#elif defined(__FreeBSD__) && __FreeBSD_version < 601103
|
#elif defined(__FreeBSD__) && __FreeBSD_version < 601103
|
||||||
h = lwres_gethostbyname_r(
|
h = lwres_gethostbyname_r( temp_host_name,
|
||||||
temp_host_name,
|
|
||||||
&h_buf,
|
&h_buf,
|
||||||
temp_hostbyname_buff,
|
temp_hostbyname_buff,
|
||||||
BUFFER_SIZE, &errcode );
|
BUFFER_SIZE, &errcode );
|
||||||
if ( h == NULL ) {
|
if ( h == NULL ) {
|
||||||
errCode = 1;
|
errCode = 1;
|
||||||
}
|
}
|
||||||
#elif defined(__OSX__)
|
#else
|
||||||
h = gethostbyname(temp_host_name);
|
errCode = gethostbyname_r( temp_host_name,
|
||||||
if ( h == NULL ) {
|
|
||||||
errCode = 1;
|
|
||||||
}
|
|
||||||
#elif defined(__linux__)
|
|
||||||
errCode = gethostbyname_r(
|
|
||||||
temp_host_name,
|
|
||||||
&h_buf,
|
&h_buf,
|
||||||
temp_hostbyname_buff,
|
temp_hostbyname_buff,
|
||||||
BUFFER_SIZE, &h, &errcode );
|
BUFFER_SIZE, &h, &errcode );
|
||||||
#else
|
|
||||||
{
|
|
||||||
struct addrinfo hints, *res, *res0;
|
|
||||||
|
|
||||||
h = NULL;
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
|
||||||
hints.ai_family = PF_INET;
|
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
|
||||||
errCode = getaddrinfo(temp_host_name, "http", &hints, &res0);
|
|
||||||
|
|
||||||
if (!errCode) {
|
|
||||||
for (res = res0; res; res = res->ai_next) {
|
|
||||||
if (res->ai_family == PF_INET &&
|
|
||||||
res->ai_addr->sa_family == AF_INET)
|
|
||||||
{
|
|
||||||
h = &h_buf;
|
|
||||||
h->h_addrtype = res->ai_addr->sa_family;
|
|
||||||
h->h_length = 4;
|
|
||||||
h->h_addr = (void *) temp_hostbyname_buff;
|
|
||||||
*(struct in_addr *)h->h_addr =
|
|
||||||
((struct sockaddr_in *)res->ai_addr)->sin_addr;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
freeaddrinfo(res0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( errCode == 0 ) {
|
if( errCode == 0 ) {
|
||||||
if( h ) {
|
if( h ) {
|
||||||
if( ( h->h_addrtype == AF_INET ) && ( h->h_length == 4 ) ) {
|
if( ( h->h_addrtype == AF_INET ) && ( h->h_length == 4 ) ) {
|
||||||
|
@@ -261,7 +261,7 @@
|
|||||||
|
|
||||||
/** @name Other debugging features
|
/** @name Other debugging features
|
||||||
The UPnP SDK contains other features to aid in debugging:
|
The UPnP SDK contains other features to aid in debugging:
|
||||||
see <upnp/inc/upnpdebug.h>
|
see <upnp/upnpdebug.h>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DEBUG_ALL 1
|
#define DEBUG_ALL 1
|
||||||
|
@@ -98,25 +98,18 @@ struct Handle_Info
|
|||||||
int aliasInstalled; // 0 = not installed; otherwise installed
|
int aliasInstalled; // 0 = not installed; otherwise installed
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ithread_rwlock_t GlobalHndRWLock;
|
extern ithread_mutex_t GlobalHndMutex;
|
||||||
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo);
|
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo);
|
||||||
|
|
||||||
#define HandleLock() HandleWriteLock()
|
#define HandleLock() \
|
||||||
|
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying Lock"); \
|
||||||
#define HandleWriteLock() \
|
ithread_mutex_lock(&GlobalHndMutex); \
|
||||||
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a write lock"); \
|
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "LOCK");
|
||||||
ithread_rwlock_wrlock(&GlobalHndRWLock); \
|
|
||||||
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Write lock acquired");
|
|
||||||
|
|
||||||
#define HandleReadLock() \
|
|
||||||
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a read lock"); \
|
|
||||||
ithread_rwlock_rdlock(&GlobalHndRWLock); \
|
|
||||||
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Read lock acquired");
|
|
||||||
|
|
||||||
#define HandleUnlock() \
|
#define HandleUnlock() \
|
||||||
UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock"); \
|
UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock"); \
|
||||||
ithread_rwlock_unlock(&GlobalHndRWLock); \
|
ithread_mutex_unlock(&GlobalHndMutex); \
|
||||||
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock");
|
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlock");
|
||||||
|
|
||||||
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out,
|
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out,
|
||||||
struct Handle_Info **HndInfo);
|
struct Handle_Info **HndInfo);
|
||||||
@@ -183,6 +176,7 @@ void UpnpThreadDistribution(struct UpnpNonblockParam * Param);
|
|||||||
void AutoAdvertise(void *input);
|
void AutoAdvertise(void *input);
|
||||||
int getlocalhostname(char *out);
|
int getlocalhostname(char *out);
|
||||||
|
|
||||||
|
virtualDirList *pVirtualDirList;
|
||||||
extern WebServerState bWebServerState;
|
extern WebServerState bWebServerState;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -125,7 +125,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
|||||||
|
|
||||||
// we are assuming that there can be only one client supported at a time
|
// we are assuming that there can be only one client supported at a time
|
||||||
|
|
||||||
HandleReadLock();
|
HandleLock();
|
||||||
|
|
||||||
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
@@ -159,7 +159,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dest addr
|
// dest addr
|
||||||
memcpy(¶m.DestAddr, dest_addr, sizeof(struct sockaddr_in) );
|
param.DestAddr = dest_addr;
|
||||||
|
|
||||||
// EXT
|
// EXT
|
||||||
param.Ext[0] = '\0';
|
param.Ext[0] = '\0';
|
||||||
@@ -267,7 +267,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
|||||||
strlen( param.Location ) == 0 || !usn_found || !st_found ) {
|
strlen( param.Location ) == 0 || !usn_found || !st_found ) {
|
||||||
return; // bad reply
|
return; // bad reply
|
||||||
}
|
}
|
||||||
// check each current search
|
//check each current search
|
||||||
HandleLock();
|
HandleLock();
|
||||||
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
@@ -275,14 +275,14 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
|||||||
}
|
}
|
||||||
node = ListHead( &ctrlpt_info->SsdpSearchList );
|
node = ListHead( &ctrlpt_info->SsdpSearchList );
|
||||||
|
|
||||||
// temporary add null termination
|
//temporary add null termination
|
||||||
//save_char = hdr_value.buf[ hdr_value.length ];
|
//save_char = hdr_value.buf[ hdr_value.length ];
|
||||||
//hdr_value.buf[ hdr_value.length ] = '\0';
|
//hdr_value.buf[ hdr_value.length ] = '\0';
|
||||||
|
|
||||||
while( node != NULL ) {
|
while( node != NULL ) {
|
||||||
searchArg = node->item;
|
searchArg = node->item;
|
||||||
matched = 0;
|
matched = 0;
|
||||||
// check for match of ST header and search target
|
//check for match of ST header and search target
|
||||||
switch ( searchArg->requestType ) {
|
switch ( searchArg->requestType ) {
|
||||||
case SSDP_ALL:
|
case SSDP_ALL:
|
||||||
{
|
{
|
||||||
@@ -327,7 +327,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( matched ) {
|
if( matched ) {
|
||||||
// schedule call back
|
//schedule call back
|
||||||
threadData =
|
threadData =
|
||||||
( ResultData * ) malloc( sizeof( ResultData ) );
|
( ResultData * ) malloc( sizeof( ResultData ) );
|
||||||
if( threadData != NULL ) {
|
if( threadData != NULL ) {
|
||||||
@@ -366,7 +366,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#warning There are currently no uses of the function 'process_reply()' in the code.
|
#warning There are currently no uses of the function 'process_reply()' in the code.
|
||||||
#warning 'process_reply()' is a candidate for removal.
|
#warning 'process_reply()' is a good candidate for removal.
|
||||||
static UPNP_INLINE void
|
static UPNP_INLINE void
|
||||||
process_reply( IN char *request_buf,
|
process_reply( IN char *request_buf,
|
||||||
IN int buf_len,
|
IN int buf_len,
|
||||||
@@ -538,7 +538,8 @@ SearchByTarget( IN int Mx,
|
|||||||
if( ReqBuf == NULL )
|
if( ReqBuf == NULL )
|
||||||
return UPNP_E_OUTOF_MEMORY;
|
return UPNP_E_OUTOF_MEMORY;
|
||||||
|
|
||||||
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__, ">>> SSDP SEND >>>\n");
|
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
|
||||||
|
">>> SSDP SEND >>>\n%s\n", ReqBuf );
|
||||||
|
|
||||||
timeTillRead = Mx;
|
timeTillRead = Mx;
|
||||||
|
|
||||||
|
@@ -242,7 +242,7 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
|
|||||||
// "If a multicast resource would send a response(s) to any copy of the
|
// "If a multicast resource would send a response(s) to any copy of the
|
||||||
// request, it SHOULD send its response(s) to each copy of the request
|
// request, it SHOULD send its response(s) to each copy of the request
|
||||||
// it receives. It MUST NOT repeat its response(s) per copy of the
|
// it receives. It MUST NOT repeat its response(s) per copy of the
|
||||||
// request."
|
// reuqest."
|
||||||
//
|
//
|
||||||
// http://www.upnp.org/download/draft-goland-http-udp-04.txt
|
// http://www.upnp.org/download/draft-goland-http-udp-04.txt
|
||||||
//
|
//
|
||||||
@@ -530,6 +530,7 @@ SendReply( IN struct sockaddr_in *DestAddr,
|
|||||||
* IN char * Udn: Device UDN
|
* IN char * Udn: Device UDN
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char * Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
|
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the reply packet based on the input parameter,
|
* This function creates the reply packet based on the input parameter,
|
||||||
* and send it to the client address given in its input parameter DestAddr.
|
* and send it to the client address given in its input parameter DestAddr.
|
||||||
@@ -606,9 +607,11 @@ DeviceReply( IN struct sockaddr_in *DestAddr,
|
|||||||
* IN char *ServType: Service Type.
|
* IN char *ServType: Service Type.
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char * Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
|
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the advertisement packet based
|
* This function creates the advertisement packet based
|
||||||
* on the input parameter, and send it to the multicast channel.
|
* on the input parameter, and send it to the multicast channel.
|
||||||
|
|
||||||
*
|
*
|
||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
@@ -653,9 +656,11 @@ ServiceAdvertisement( IN char *Udn,
|
|||||||
* IN char *ServType: Service Type.
|
* IN char *ServType: Service Type.
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char * Location: Location of Device description document.
|
||||||
* IN int Duration :Life time of this device.
|
* IN int Duration :Life time of this device.
|
||||||
|
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates the advertisement packet based
|
* This function creates the advertisement packet based
|
||||||
* on the input parameter, and send it to the multicast channel.
|
* on the input parameter, and send it to the multicast channel.
|
||||||
|
|
||||||
*
|
*
|
||||||
* Returns: int
|
* Returns: int
|
||||||
* UPNP_E_SUCCESS if successful else appropriate error
|
* UPNP_E_SUCCESS if successful else appropriate error
|
||||||
@@ -695,6 +700,7 @@ ServiceReply( IN struct sockaddr_in *DestAddr,
|
|||||||
* IN char *ServType: Service Type.
|
* IN char *ServType: Service Type.
|
||||||
* IN char * Location: Location of Device description document.
|
* IN char * Location: Location of Device description document.
|
||||||
* IN int Duration :Service duration in sec.
|
* IN int Duration :Service duration in sec.
|
||||||
|
|
||||||
* Description:
|
* Description:
|
||||||
* This function creates a HTTP service shutdown request packet
|
* This function creates a HTTP service shutdown request packet
|
||||||
* and sent it to the multicast channel through RequestHandler.
|
* and sent it to the multicast channel through RequestHandler.
|
||||||
@@ -815,4 +821,3 @@ DeviceShutdown( IN char *DevType,
|
|||||||
|
|
||||||
#endif // EXCLUDE_SSDP
|
#endif // EXCLUDE_SSDP
|
||||||
#endif // INCLUDE_DEVICE_APIS
|
#endif // INCLUDE_DEVICE_APIS
|
||||||
|
|
||||||
|
@@ -75,9 +75,7 @@ CLIENTONLY( SOCKET gSsdpReqSocket = 0;
|
|||||||
* Function : AdvertiseAndReply
|
* Function : AdvertiseAndReply
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* IN int AdFlag:
|
* IN int AdFlag: -1 = Send shutdown, 0 = send reply,
|
||||||
* -1 = Send shutdown,
|
|
||||||
* 0 = send reply,
|
|
||||||
* 1 = Send Advertisement
|
* 1 = Send Advertisement
|
||||||
* IN UpnpDevice_Handle Hnd: Device handle
|
* IN UpnpDevice_Handle Hnd: Device handle
|
||||||
* IN enum SsdpSearchType SearchType:Search type for sending replies
|
* IN enum SsdpSearchType SearchType:Search type for sending replies
|
||||||
@@ -122,13 +120,16 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
"Inside AdvertiseAndReply with AdFlag = %d\n",
|
"Inside AdvertiseAndReply with AdFlag = %d\n",
|
||||||
AdFlag );
|
AdFlag );
|
||||||
|
|
||||||
// Use a read lock
|
HandleLock();
|
||||||
HandleReadLock();
|
|
||||||
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
|
||||||
HandleUnlock();
|
HandleUnlock();
|
||||||
return UPNP_E_INVALID_HANDLE;
|
return UPNP_E_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
defaultExp = SInfo->MaxAge;
|
defaultExp = SInfo->MaxAge;
|
||||||
|
|
||||||
|
//Modifed to prevent more than one thread from accessing the
|
||||||
|
//UpnpDocument stored with the handle at the same time
|
||||||
|
// HandleUnlock();
|
||||||
nodeList = NULL;
|
nodeList = NULL;
|
||||||
|
|
||||||
//get server info
|
//get server info
|
||||||
@@ -150,12 +151,14 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
|
|
||||||
dbgStr = ixmlNode_getNodeName( tmpNode );
|
dbgStr = ixmlNode_getNodeName( tmpNode );
|
||||||
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
|
||||||
"Extracting device type once for %s\n", dbgStr );
|
"Extracting device type once for %s\n",
|
||||||
|
dbgStr );
|
||||||
// extract device type
|
// extract device type
|
||||||
ixmlNodeList_free( nodeList );
|
ixmlNodeList_free( nodeList );
|
||||||
nodeList = NULL;
|
nodeList = NULL;
|
||||||
nodeList = ixmlElement_getElementsByTagName(
|
nodeList =
|
||||||
( IXML_Element * ) tmpNode, "deviceType" );
|
ixmlElement_getElementsByTagName( ( IXML_Element * ) tmpNode,
|
||||||
|
"deviceType" );
|
||||||
if( nodeList == NULL ) {
|
if( nodeList == NULL ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -163,6 +166,7 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
dbgStr = ixmlNode_getNodeName( tmpNode );
|
dbgStr = ixmlNode_getNodeName( tmpNode );
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Extracting UDN for %s\n", dbgStr );
|
"Extracting UDN for %s\n", dbgStr );
|
||||||
|
|
||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Extracting device type\n" );
|
"Extracting device type\n" );
|
||||||
|
|
||||||
@@ -237,7 +241,8 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
if( AdFlag == 1 ) {
|
if( AdFlag == 1 ) {
|
||||||
DeviceAdvertisement( devType, i == 0,
|
DeviceAdvertisement( devType, i == 0,
|
||||||
UDNstr, SInfo->DescURL, Exp );
|
UDNstr, SInfo->DescURL, Exp );
|
||||||
} else { // AdFlag == -1
|
} else // AdFlag == -1
|
||||||
|
{
|
||||||
DeviceShutdown( devType, i == 0, UDNstr,
|
DeviceShutdown( devType, i == 0, UDNstr,
|
||||||
SERVER, SInfo->DescURL, Exp );
|
SERVER, SInfo->DescURL, Exp );
|
||||||
}
|
}
|
||||||
@@ -319,9 +324,8 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
}
|
}
|
||||||
for( j = 0;; j++ ) {
|
for( j = 0;; j++ ) {
|
||||||
tmpNode = ixmlNodeList_item( nodeList, j );
|
tmpNode = ixmlNodeList_item( nodeList, j );
|
||||||
if( tmpNode == NULL ) {
|
if( tmpNode == NULL )
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
ixmlNodeList_free( tmpNodeList );
|
ixmlNodeList_free( tmpNodeList );
|
||||||
tmpNodeList = NULL;
|
tmpNodeList = NULL;
|
||||||
@@ -363,21 +367,26 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
} else {
|
} else {
|
||||||
switch ( SearchType ) {
|
switch ( SearchType ) {
|
||||||
case SSDP_ALL:
|
case SSDP_ALL:
|
||||||
|
{
|
||||||
ServiceReply( DestAddr, servType,
|
ServiceReply( DestAddr, servType,
|
||||||
UDNstr, SInfo->DescURL,
|
UDNstr, SInfo->DescURL,
|
||||||
defaultExp );
|
defaultExp );
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SSDP_SERVICE:
|
case SSDP_SERVICE:
|
||||||
|
{
|
||||||
if( ServiceType != NULL ) {
|
if( ServiceType != NULL ) {
|
||||||
if( !strncasecmp( ServiceType,
|
if( !strncasecmp( ServiceType,
|
||||||
servType,
|
servType,
|
||||||
strlen( ServiceType ) ) ) {
|
strlen( ServiceType ) ) )
|
||||||
|
{
|
||||||
ServiceReply( DestAddr, servType,
|
ServiceReply( DestAddr, servType,
|
||||||
UDNstr, SInfo->DescURL,
|
UDNstr, SInfo->DescURL,
|
||||||
defaultExp );
|
defaultExp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
} // switch(SearchType)
|
} // switch(SearchType)
|
||||||
@@ -392,7 +401,7 @@ int AdvertiseAndReply( IN int AdFlag,
|
|||||||
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
|
||||||
"Exiting AdvertiseAndReply : \n" );
|
"Exiting AdvertiseAndReply : \n" );
|
||||||
|
|
||||||
HandleUnlock();
|
HandleUnlock( );
|
||||||
|
|
||||||
return UPNP_E_SUCCESS;
|
return UPNP_E_SUCCESS;
|
||||||
|
|
||||||
@@ -810,20 +819,18 @@ readFromSSDPSocket( SOCKET socket )
|
|||||||
( struct sockaddr * )&clientAddr, &socklen );
|
( struct sockaddr * )&clientAddr, &socklen );
|
||||||
|
|
||||||
if( byteReceived > 0 ) {
|
if( byteReceived > 0 ) {
|
||||||
|
|
||||||
requestBuf[byteReceived] = '\0';
|
requestBuf[byteReceived] = '\0';
|
||||||
UpnpPrintf( UPNP_INFO, SSDP,
|
UpnpPrintf( UPNP_INFO, SSDP,
|
||||||
__FILE__, __LINE__,
|
__FILE__, __LINE__,
|
||||||
"Start of received response ----------------------------------------------------\n"
|
"Received response !!! "
|
||||||
"%s\n"
|
"%s From host %s \n",
|
||||||
"End of received response ------------------------------------------------------\n"
|
|
||||||
"From host %s\n",
|
|
||||||
requestBuf,
|
requestBuf,
|
||||||
inet_ntoa( clientAddr.sin_addr ) );
|
inet_ntoa( clientAddr.sin_addr ) );
|
||||||
|
|
||||||
UpnpPrintf( UPNP_PACKET, SSDP, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_PACKET, SSDP, __FILE__, __LINE__,
|
||||||
"Start of received multicast packet --------------------------------------------\n"
|
"Received multicast packet:"
|
||||||
"%s\n"
|
"\n %s\n", requestBuf );
|
||||||
"End of received multicast packet ----------------------------------------------\n",
|
|
||||||
requestBuf );
|
|
||||||
//add thread pool job to handle request
|
//add thread pool job to handle request
|
||||||
if( data != NULL ) {
|
if( data != NULL ) {
|
||||||
data->parser.msg.msg.length += byteReceived;
|
data->parser.msg.msg.length += byteReceived;
|
||||||
@@ -862,7 +869,8 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
{
|
{
|
||||||
SOCKET ssdpSock;
|
SOCKET ssdpSock;
|
||||||
|
|
||||||
CLIENTONLY( SOCKET ssdpReqSock; )
|
CLIENTONLY( SOCKET ssdpReqSock;
|
||||||
|
)
|
||||||
int onOff = 1;
|
int onOff = 1;
|
||||||
u_char ttl = 4;
|
u_char ttl = 4;
|
||||||
struct ip_mreq ssdpMcastAddr;
|
struct ip_mreq ssdpMcastAddr;
|
||||||
@@ -870,20 +878,20 @@ get_ssdp_sockets( MiniServerSockArray * out )
|
|||||||
int option = 1;
|
int option = 1;
|
||||||
struct in_addr addr;
|
struct in_addr addr;
|
||||||
|
|
||||||
CLIENTONLY(
|
CLIENTONLY( if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) )
|
||||||
if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == UPNP_INVALID_SOCKET ) {
|
== UPNP_INVALID_SOCKET ) {
|
||||||
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,
|
||||||
setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
IPPROTO_IP,
|
||||||
|
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
||||||
// just do it, regardless if fails or not.
|
// just do it, regardless if fails or not.
|
||||||
Make_Socket_NoBlocking( ssdpReqSock );
|
Make_Socket_NoBlocking( ssdpReqSock ); gSsdpReqSocket = ssdpReqSock; ) //CLIENTONLY
|
||||||
gSsdpReqSocket = ssdpReqSock; )
|
|
||||||
// END CLIENTONLY
|
|
||||||
|
|
||||||
if( ( ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == UPNP_INVALID_SOCKET ) {
|
if( ( ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 ) )
|
||||||
|
== UPNP_INVALID_SOCKET ) {
|
||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
"Error in socket operation !!!\n" );
|
"Error in socket operation !!!\n" );
|
||||||
@@ -895,6 +903,7 @@ CLIENTONLY(
|
|||||||
onOff = 1;
|
onOff = 1;
|
||||||
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR,
|
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR,
|
||||||
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
|
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
|
||||||
|
|
||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
"Error in set reuse addr !!!\n" );
|
"Error in set reuse addr !!!\n" );
|
||||||
@@ -908,6 +917,7 @@ CLIENTONLY(
|
|||||||
#ifdef __FreeBSD__
|
#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,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
"Error in set reuse port !!!\n" );
|
"Error in set reuse port !!!\n" );
|
||||||
@@ -924,7 +934,8 @@ CLIENTONLY(
|
|||||||
// ssdpAddr.sin_addr.s_addr = inet_addr(LOCAL_HOST);
|
// ssdpAddr.sin_addr.s_addr = inet_addr(LOCAL_HOST);
|
||||||
ssdpAddr.sin_addr.s_addr = htonl( INADDR_ANY );
|
ssdpAddr.sin_addr.s_addr = htonl( INADDR_ANY );
|
||||||
ssdpAddr.sin_port = htons( SSDP_PORT );
|
ssdpAddr.sin_port = htons( SSDP_PORT );
|
||||||
if( bind( ssdpSock, ( struct sockaddr * )&ssdpAddr,
|
if( bind
|
||||||
|
( ssdpSock, ( struct sockaddr * )&ssdpAddr,
|
||||||
sizeof( ssdpAddr ) ) != 0 ) {
|
sizeof( ssdpAddr ) ) != 0 ) {
|
||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
@@ -940,7 +951,8 @@ CLIENTONLY(
|
|||||||
ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST );
|
ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST );
|
||||||
ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
|
ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
|
||||||
if( setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
if( setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
|
||||||
( char * )&ssdpMcastAddr, sizeof( struct ip_mreq ) ) != 0 ) {
|
( char * )&ssdpMcastAddr,
|
||||||
|
sizeof( struct ip_mreq ) ) != 0 ) {
|
||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
"Error in joining" " multicast group !!!\n" );
|
"Error in joining" " multicast group !!!\n" );
|
||||||
@@ -954,7 +966,7 @@ CLIENTONLY(
|
|||||||
/* Set multicast interface. */
|
/* Set multicast interface. */
|
||||||
memset( ( void * )&addr, 0, sizeof( struct in_addr ));
|
memset( ( void * )&addr, 0, sizeof( struct in_addr ));
|
||||||
addr.s_addr = inet_addr(LOCAL_HOST);
|
addr.s_addr = inet_addr(LOCAL_HOST);
|
||||||
if ( setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF,
|
if (setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF,
|
||||||
(char *)&addr, sizeof addr) != 0) {
|
(char *)&addr, sizeof addr) != 0) {
|
||||||
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
|
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
|
||||||
"Couldn't set multicast interface.\n" );
|
"Couldn't set multicast interface.\n" );
|
||||||
@@ -965,7 +977,7 @@ CLIENTONLY(
|
|||||||
setsockopt( ssdpSock, IPPROTO_IP,
|
setsockopt( ssdpSock, IPPROTO_IP,
|
||||||
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
|
||||||
if( setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST,
|
if( setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST,
|
||||||
(char *)&option, sizeof(option) ) != 0) {
|
( char * )&option, sizeof( option ) ) != 0 ) {
|
||||||
UpnpPrintf( UPNP_CRITICAL,
|
UpnpPrintf( UPNP_CRITICAL,
|
||||||
SSDP, __FILE__, __LINE__,
|
SSDP, __FILE__, __LINE__,
|
||||||
"Error in setting broadcast !!!\n" );
|
"Error in setting broadcast !!!\n" );
|
||||||
@@ -976,10 +988,10 @@ CLIENTONLY(
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EXCLUDE_SSDP
|
#endif // EXCLUDE_SSDP
|
||||||
|
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@@ -50,11 +50,22 @@
|
|||||||
#define S43 15
|
#define S43 15
|
||||||
#define S44 21
|
#define S44 21
|
||||||
|
|
||||||
static void MD5Transform PROTO_LIST((UINT4[4], unsigned char[64]));
|
static void MD5Transform PROTO_LIST( ( UINT4[4],
|
||||||
static void Encode PROTO_LIST((unsigned char *, UINT4 *, unsigned int));
|
unsigned char[64] ) );
|
||||||
static void Decode PROTO_LIST((UINT4 *, unsigned char *, unsigned int));
|
static void Encode PROTO_LIST( ( unsigned char *,
|
||||||
static void MD5_memcpy PROTO_LIST((POINTER, POINTER, unsigned int));
|
UINT4 *,
|
||||||
static void MD5_memset PROTO_LIST((POINTER, int, unsigned int));
|
unsigned int ) );
|
||||||
|
|
||||||
|
static void Decode PROTO_LIST( ( UINT4 *,
|
||||||
|
unsigned char *,
|
||||||
|
unsigned int ) );
|
||||||
|
|
||||||
|
static void MD5_memcpy PROTO_LIST( ( POINTER,
|
||||||
|
POINTER,
|
||||||
|
unsigned int ) );
|
||||||
|
static void MD5_memset PROTO_LIST( ( POINTER,
|
||||||
|
int,
|
||||||
|
unsigned int ) );
|
||||||
|
|
||||||
static unsigned char PADDING[64] = {
|
static unsigned char PADDING[64] = {
|
||||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
@@ -107,10 +118,14 @@ static unsigned char PADDING[64] = {
|
|||||||
MD5 initialization. Begins an MD5 operation, writing a new context.
|
MD5 initialization. Begins an MD5 operation, writing a new context.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
MD5Init(MD5_CTX * context)
|
MD5Init( context )
|
||||||
|
MD5_CTX *context; /* context */
|
||||||
{
|
{
|
||||||
context->count[0] = context->count[1] = 0;
|
context->count[0] = context->count[1] = 0;
|
||||||
/* Load magic initialization constants. */
|
|
||||||
|
/*
|
||||||
|
Load magic initialization constants.
|
||||||
|
*/
|
||||||
context->state[0] = 0x67452301;
|
context->state[0] = 0x67452301;
|
||||||
context->state[1] = 0xefcdab89;
|
context->state[1] = 0xefcdab89;
|
||||||
context->state[2] = 0x98badcfe;
|
context->state[2] = 0x98badcfe;
|
||||||
@@ -124,72 +139,114 @@ MD5Init(MD5_CTX * context)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
|
MD5Update( context,
|
||||||
|
input,
|
||||||
|
inputLen )
|
||||||
|
MD5_CTX *context; /* context */
|
||||||
|
unsigned char *input; /* input block */
|
||||||
|
unsigned int inputLen; /* length of input block */
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i,
|
||||||
unsigned int index;
|
index,
|
||||||
unsigned int partLen;
|
partLen;
|
||||||
|
|
||||||
/* Compute number of bytes mod 64 */
|
/*
|
||||||
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
Compute number of bytes mod 64
|
||||||
|
*/
|
||||||
|
index = ( unsigned int )( ( context->count[0] >> 3 ) & 0x3F );
|
||||||
|
|
||||||
/* Update number of bits */
|
/*
|
||||||
if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) {
|
Update number of bits
|
||||||
|
*/
|
||||||
|
if( ( context->count[0] +=
|
||||||
|
( ( UINT4 ) inputLen << 3 ) ) < ( ( UINT4 ) inputLen << 3 ) )
|
||||||
context->count[1]++;
|
context->count[1]++;
|
||||||
}
|
|
||||||
context->count[1] += ((UINT4)inputLen >> 29);
|
context->count[1] += ( ( UINT4 ) inputLen >> 29 );
|
||||||
|
|
||||||
partLen = 64 - index;
|
partLen = 64 - index;
|
||||||
|
|
||||||
/* Transform as many times as possible. */
|
/*
|
||||||
if (inputLen >= partLen) {
|
Transform as many times as possible.
|
||||||
MD5_memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
*/
|
||||||
MD5Transform(context->state, context->buffer);
|
if( inputLen >= partLen ) {
|
||||||
for (i = partLen; i + 63 < inputLen; i += 64) {
|
|
||||||
MD5Transform(context->state, &input[i]);
|
MD5_memcpy
|
||||||
}
|
( ( POINTER ) & context->buffer[index], ( POINTER ) input,
|
||||||
index = 0;
|
partLen );
|
||||||
} else {
|
MD5Transform( context->state, context->buffer );
|
||||||
i = 0;
|
|
||||||
}
|
for( i = partLen; i + 63 < inputLen; i += 64 )
|
||||||
|
MD5Transform( context->state, &input[i] );
|
||||||
|
|
||||||
|
index = 0;
|
||||||
|
} else
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Buffer remaining input
|
||||||
|
*/
|
||||||
|
MD5_memcpy
|
||||||
|
( ( POINTER ) & context->buffer[index], ( POINTER ) & input[i],
|
||||||
|
inputLen - i );
|
||||||
|
|
||||||
/* Buffer remaining input */
|
|
||||||
MD5_memcpy((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen - i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MD5 finalization. Ends an MD5 message-digest operation, writing the
|
MD5 finalization. Ends an MD5 message-digest operation, writing the
|
||||||
the message digest and zeroizing the context.
|
the message digest and zeroizing the context.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
MD5Final(unsigned char digest[16], MD5_CTX *context)
|
MD5Final( digest,
|
||||||
|
context )
|
||||||
|
unsigned char digest[16]; /* message digest */
|
||||||
|
MD5_CTX *context; /* context */
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned char bits[8];
|
unsigned char bits[8];
|
||||||
unsigned int index;
|
unsigned int index,
|
||||||
unsigned int padLen;
|
padLen;
|
||||||
|
|
||||||
/* Save number of bits */
|
/*
|
||||||
Encode(bits, context->count, 8);
|
Save number of bits
|
||||||
|
*/
|
||||||
|
Encode( bits, context->count, 8 );
|
||||||
|
|
||||||
/* Pad out to 56 mod 64. */
|
/*
|
||||||
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
Pad out to 56 mod 64.
|
||||||
padLen = (index < 56) ? (56 - index) : (120 - index);
|
*/
|
||||||
MD5Update(context, PADDING, padLen);
|
index = ( unsigned int )( ( context->count[0] >> 3 ) & 0x3f );
|
||||||
|
|
||||||
/* Append length (before padding) */
|
padLen = ( index < 56 ) ? ( 56 - index ) : ( 120 - index );
|
||||||
MD5Update(context, bits, 8);
|
|
||||||
|
|
||||||
/* Store state in digest */
|
MD5Update( context, PADDING, padLen );
|
||||||
Encode(digest, context->state, 16);
|
|
||||||
|
/*
|
||||||
|
Append length (before padding)
|
||||||
|
*/
|
||||||
|
MD5Update( context, bits, 8 );
|
||||||
|
|
||||||
|
/*
|
||||||
|
Store state in digest
|
||||||
|
*/
|
||||||
|
Encode( digest, context->state, 16 );
|
||||||
|
|
||||||
|
/*
|
||||||
|
Zeroize sensitive information.
|
||||||
|
*/
|
||||||
|
MD5_memset( ( POINTER ) context, 0, sizeof( *context ) );
|
||||||
|
|
||||||
/* Zeroize sensitive information. */
|
|
||||||
MD5_memset((POINTER)context, 0, sizeof(*context));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MD5 basic transformation. Transforms state based on block.
|
MD5 basic transformation. Transforms state based on block.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
MD5Transform(UINT4 state[4], unsigned char block[64])
|
MD5Transform( state,
|
||||||
|
block )
|
||||||
|
UINT4 state[4];
|
||||||
|
unsigned char block[64];
|
||||||
{
|
{
|
||||||
UINT4 a = state[0],
|
UINT4 a = state[0],
|
||||||
b = state[1],
|
b = state[1],
|
||||||
@@ -296,16 +353,23 @@ MD5Transform(UINT4 state[4], unsigned char block[64])
|
|||||||
a multiple of 4.
|
a multiple of 4.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
Encode(unsigned char *output, UINT4 *input, unsigned int len)
|
Encode( output,
|
||||||
|
input,
|
||||||
|
len )
|
||||||
|
unsigned char *output;
|
||||||
|
UINT4 *input;
|
||||||
|
unsigned int len;
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i,
|
||||||
unsigned int j;
|
j;
|
||||||
for (i = 0, j = 0; j < len; ++i, j += 4) {
|
|
||||||
output[j+0] = (unsigned char)((input[i] >> 0) & 0xff);
|
for( i = 0, j = 0; j < len; i++, j += 4 ) {
|
||||||
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
output[j] = ( unsigned char )( input[i] & 0xff );
|
||||||
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
output[j + 1] = ( unsigned char )( ( input[i] >> 8 ) & 0xff );
|
||||||
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
|
output[j + 2] = ( unsigned char )( ( input[i] >> 16 ) & 0xff );
|
||||||
|
output[j + 3] = ( unsigned char )( ( input[i] >> 24 ) & 0xff );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -314,40 +378,55 @@ Encode(unsigned char *output, UINT4 *input, unsigned int len)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Decode(UINT4 *output, unsigned char *input, unsigned int len)
|
Decode( output,
|
||||||
|
input,
|
||||||
|
len )
|
||||||
|
UINT4 *output;
|
||||||
|
unsigned char *input;
|
||||||
|
unsigned int len;
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i,
|
||||||
unsigned int j;
|
j;
|
||||||
for (i = 0, j = 0; j < len; ++i, j += 4) {
|
|
||||||
|
for( i = 0, j = 0; j < len; i++, j += 4 )
|
||||||
output[i] =
|
output[i] =
|
||||||
(((UINT4)input[j+0]) << 0) |
|
( ( UINT4 ) input[j] ) | ( ( ( UINT4 ) input[j + 1] ) << 8 ) |
|
||||||
(((UINT4)input[j+1]) << 8) |
|
( ( ( UINT4 ) input[j + 2] ) << 16 ) |
|
||||||
(((UINT4)input[j+2]) << 16) |
|
( ( ( UINT4 ) input[j + 3] ) << 24 );
|
||||||
(((UINT4)input[j+3]) << 24);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Note: Replace for loop with standard memcpy if possible.
|
Note: Replace "for loop" with standard memcpy if possible.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
MD5_memcpy(POINTER output, POINTER input, unsigned int len)
|
MD5_memcpy( output,
|
||||||
|
input,
|
||||||
|
len )
|
||||||
|
POINTER output;
|
||||||
|
POINTER input;
|
||||||
|
unsigned int len;
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < len; ++i) {
|
|
||||||
|
for( i = 0; i < len; i++ )
|
||||||
output[i] = input[i];
|
output[i] = input[i];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Note: Replace for loop with standard memset if possible.
|
Note: Replace "for loop" with standard memset if possible.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
MD5_memset(POINTER output, int value, unsigned int len)
|
MD5_memset( output,
|
||||||
|
value,
|
||||||
|
len )
|
||||||
|
POINTER output;
|
||||||
|
int value;
|
||||||
|
unsigned int len;
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < len; ++i) {
|
|
||||||
((char *)output)[i] = (char)value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
for( i = 0; i < len; i++ )
|
||||||
|
( ( char * )output )[i] = ( char )value;
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -33,16 +33,17 @@
|
|||||||
This sample implementation generates a random node ID
|
This sample implementation generates a random node ID
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
get_ieee_node_identifier(uuid_node_t *node)
|
get_ieee_node_identifier( uuid_node_t * node )
|
||||||
{
|
{
|
||||||
char seed[16];
|
char seed[16];
|
||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
static uuid_node_t saved_node;
|
static uuid_node_t saved_node;
|
||||||
|
|
||||||
if (!inited) {
|
if( !inited ) {
|
||||||
get_random_info(seed);
|
get_random_info( seed );
|
||||||
seed[0] |= 0x80;
|
seed[0] |= 0x80;
|
||||||
memcpy(&saved_node, seed, sizeof (uuid_node_t));
|
memcpy( &saved_node, seed, sizeof( uuid_node_t ) );
|
||||||
|
|
||||||
inited = 1;
|
inited = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ get_system_time( uuid_time_t * uuid_time )
|
|||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
get_random_info(char seed[16])
|
get_random_info( char seed[16] )
|
||||||
{
|
{
|
||||||
MD5_CTX c;
|
MD5_CTX c;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -96,34 +97,38 @@ get_random_info(char seed[16])
|
|||||||
} randomness;
|
} randomness;
|
||||||
randomness r;
|
randomness r;
|
||||||
|
|
||||||
/* Initialize memory area so that valgrind does not complain */
|
MD5Init( &c );
|
||||||
memset(&r, 0, sizeof r);
|
/*
|
||||||
|
memory usage stats
|
||||||
/* memory usage stats */
|
*/
|
||||||
GlobalMemoryStatus( &r.m );
|
GlobalMemoryStatus( &r.m );
|
||||||
/* random system stats */
|
/*
|
||||||
|
random system stats
|
||||||
|
*/
|
||||||
GetSystemInfo( &r.s );
|
GetSystemInfo( &r.s );
|
||||||
/* 100ns resolution (nominally) time of day */
|
/*
|
||||||
|
100ns resolution (nominally) time of day
|
||||||
|
*/
|
||||||
GetSystemTimeAsFileTime( &r.t );
|
GetSystemTimeAsFileTime( &r.t );
|
||||||
/* high resolution performance counter */
|
/*
|
||||||
|
high resolution performance counter
|
||||||
|
*/
|
||||||
QueryPerformanceCounter( &r.pc );
|
QueryPerformanceCounter( &r.pc );
|
||||||
/* milliseconds since last boot */
|
/*
|
||||||
r.tc = GetTickCount();
|
milliseconds since last boot
|
||||||
|
*/
|
||||||
|
r.tc = GetTickCount( );
|
||||||
r.l = MAX_COMPUTERNAME_LENGTH + 1;
|
r.l = MAX_COMPUTERNAME_LENGTH + 1;
|
||||||
|
|
||||||
GetComputerName( r.hostname, &r.l );
|
GetComputerName( r.hostname, &r.l );
|
||||||
|
MD5Update( &c, &r, sizeof( randomness ) );
|
||||||
/* MD5 it */
|
MD5Final( seed, &c );
|
||||||
MD5Init(&c);
|
|
||||||
MD5Update(&c, &r, sizeof r);
|
|
||||||
MD5Final(seed, &c);
|
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
#else /* _WINDOWS_ */
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
get_system_time(uuid_time_t *uuid_time)
|
get_system_time( uuid_time_t * uuid_time )
|
||||||
{
|
{
|
||||||
struct timeval tp;
|
struct timeval tp;
|
||||||
|
|
||||||
@@ -140,28 +145,22 @@ get_system_time(uuid_time_t *uuid_time)
|
|||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
get_random_info(char seed[16])
|
get_random_info( char seed[16] )
|
||||||
{
|
{
|
||||||
MD5_CTX c;
|
MD5_CTX c;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
//struct sysinfo s;
|
// struct sysinfo s;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
char hostname[257];
|
char hostname[257];
|
||||||
} randomness;
|
} randomness;
|
||||||
randomness r;
|
randomness r;
|
||||||
|
|
||||||
/* Initialize memory area so that valgrind does not complain */
|
MD5Init( &c );
|
||||||
memset(&r, 0, sizeof r);
|
|
||||||
|
|
||||||
/* Get some random stuff */
|
gettimeofday( &r.t, ( struct timezone * )0 );
|
||||||
gettimeofday(&r.t, (struct timezone *)0);
|
gethostname( r.hostname, 256 );
|
||||||
gethostname(r.hostname, 256 );
|
MD5Update( &c, &r, sizeof( randomness ) );
|
||||||
|
MD5Final( seed, &c );
|
||||||
/* MD5 it */
|
|
||||||
MD5Init(&c);
|
|
||||||
MD5Update(&c, &r, sizeof r);
|
|
||||||
MD5Final(seed, &c);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _WINDOWS_ */
|
#endif
|
||||||
|
|
||||||
|
@@ -53,10 +53,10 @@ static unsigned16 true_random( void );
|
|||||||
uuid_create -- generator a UUID
|
uuid_create -- generator a UUID
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
uuid_create(uuid_upnp *uid)
|
uuid_create( uuid_upnp * uid )
|
||||||
{
|
{
|
||||||
uuid_time_t timestamp;
|
uuid_time_t timestamp,
|
||||||
uuid_time_t last_time;
|
last_time;
|
||||||
unsigned16 clockseq;
|
unsigned16 clockseq;
|
||||||
uuid_node_t node;
|
uuid_node_t node;
|
||||||
uuid_node_t last_node;
|
uuid_node_t last_node;
|
||||||
@@ -65,64 +65,61 @@ uuid_create(uuid_upnp *uid)
|
|||||||
/*
|
/*
|
||||||
acquire system wide lock so we're alone
|
acquire system wide lock so we're alone
|
||||||
*/
|
*/
|
||||||
UUIDLock();
|
UUIDLock( );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
get current time
|
get current time
|
||||||
*/
|
*/
|
||||||
get_current_time(×tamp);
|
get_current_time( ×tamp );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
get node ID
|
get node ID
|
||||||
*/
|
*/
|
||||||
get_ieee_node_identifier(&node);
|
get_ieee_node_identifier( &node );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
get saved state from NV storage
|
get saved state from NV storage
|
||||||
*/
|
*/
|
||||||
f = read_state(&clockseq, &last_time, &last_node);
|
f = read_state( &clockseq, &last_time, &last_node );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if no NV state, or if clock went backwards, or node ID changed
|
if no NV state, or if clock went backwards, or node ID changed
|
||||||
(e.g., net card swap) change clockseq
|
(e.g., net card swap) change clockseq
|
||||||
*/
|
*/
|
||||||
if (!f || memcmp(&node, &last_node, sizeof(uuid_node_t))) {
|
if( !f || memcmp( &node, &last_node, sizeof( uuid_node_t ) ) )
|
||||||
clockseq = true_random();
|
clockseq = true_random( );
|
||||||
} else if (timestamp < last_time) {
|
else if( timestamp < last_time )
|
||||||
clockseq++;
|
clockseq++;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
stuff fields into the UUID
|
stuff fields into the UUID
|
||||||
*/
|
*/
|
||||||
format_uuid_v1(uid, clockseq, timestamp, node);
|
format_uuid_v1( uid, clockseq, timestamp, node );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
save the state for next time
|
save the state for next time
|
||||||
*/
|
*/
|
||||||
write_state(clockseq, timestamp, node);
|
write_state( clockseq, timestamp, node );
|
||||||
|
|
||||||
UUIDUnlock();
|
UUIDUnlock( );
|
||||||
return 1;
|
return ( 1 );
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
uuid_unpack(uuid_upnp *u, char *out)
|
uuid_unpack( uuid_upnp * u,
|
||||||
|
char *out )
|
||||||
{
|
{
|
||||||
sprintf(out,
|
|
||||||
|
sprintf( out,
|
||||||
"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
|
"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
|
||||||
(unsigned int)u->time_low,
|
( unsigned int )u->time_low, u->time_mid,
|
||||||
u->time_mid,
|
u->time_hi_and_version, u->clock_seq_hi_and_reserved,
|
||||||
u->time_hi_and_version,
|
u->clock_seq_low, u->node[0], u->node[1], u->node[2],
|
||||||
u->clock_seq_hi_and_reserved,
|
u->node[3], u->node[4], u->node[5] );
|
||||||
u->clock_seq_low,
|
|
||||||
u->node[0],
|
*( out + 36 ) = '\0';
|
||||||
u->node[1],
|
|
||||||
u->node[2],
|
|
||||||
u->node[3],
|
|
||||||
u->node[4],
|
|
||||||
u->node[5]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
@@ -140,10 +137,11 @@ format_uuid_v1( uuid_upnp * uid,
|
|||||||
Construct a version 1 uuid with the information we've gathered
|
Construct a version 1 uuid with the information we've gathered
|
||||||
* plus a few constants.
|
* plus a few constants.
|
||||||
*/
|
*/
|
||||||
uid->time_low = (unsigned long)(timestamp & 0xFFFFFFFF);
|
uid->time_low = ( unsigned long )( timestamp & 0xFFFFFFFF );
|
||||||
uid->time_mid = (unsigned short)((timestamp >> 32) & 0xFFFF);
|
uid->time_mid = ( unsigned short )( ( timestamp >> 32 ) & 0xFFFF );
|
||||||
uid->time_hi_and_version = (unsigned short)((timestamp >> 48) & 0x0FFF);
|
uid->time_hi_and_version = ( unsigned short )( ( timestamp >> 48 ) &
|
||||||
uid->time_hi_and_version |= (1 << 12);
|
0x0FFF );
|
||||||
|
uid->time_hi_and_version |= ( 1 << 12 );
|
||||||
uid->clock_seq_low = clock_seq & 0xFF;
|
uid->clock_seq_low = clock_seq & 0xFF;
|
||||||
uid->clock_seq_hi_and_reserved = ( clock_seq & 0x3F00 ) >> 8;
|
uid->clock_seq_hi_and_reserved = ( clock_seq & 0x3F00 ) >> 8;
|
||||||
uid->clock_seq_hi_and_reserved |= 0x80;
|
uid->clock_seq_hi_and_reserved |= 0x80;
|
||||||
@@ -229,6 +227,7 @@ get_current_time( uuid_time_t * timestamp )
|
|||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
|
|
||||||
if( !inited ) {
|
if( !inited ) {
|
||||||
|
get_system_time( &time_now );
|
||||||
uuids_this_tick = UUIDS_PER_TICK;
|
uuids_this_tick = UUIDS_PER_TICK;
|
||||||
inited = 1;
|
inited = 1;
|
||||||
};
|
};
|
||||||
|
@@ -105,7 +105,7 @@ main (int argc, char* argv[])
|
|||||||
* Test library initialisation
|
* Test library initialisation
|
||||||
*/
|
*/
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
printf ("Initializing UPnP ... \n");
|
printf ("Intializing UPnP ... \n");
|
||||||
rc = UpnpInit (NULL, 0);
|
rc = UpnpInit (NULL, 0);
|
||||||
if ( UPNP_E_SUCCESS == rc ) {
|
if ( UPNP_E_SUCCESS == rc ) {
|
||||||
const char* ip_address = UpnpGetServerIpAddress();
|
const char* ip_address = UpnpGetServerIpAddress();
|
||||||
|
Reference in New Issue
Block a user