Compare commits

..

172 Commits

Author SHA1 Message Date
Marcelo Roberto Jimenez
46cc47b167 Created tag for the new release.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/tags/release-1.6.1@238 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-08 02:22:05 +00:00
Marcelo Roberto Jimenez
13a1fff7a1 SF Bug Tracker [ 1825278 ] AdvertiseAndReply sleeps with handle lock out
Applied patch from Alex (afaucher) to change some write locks to read
locks.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@237 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-08 01:54:50 +00:00
Marcelo Roberto Jimenez
c9463545a8 Small fix for changelog.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@235 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-06 02:43:44 +00:00
Marcelo Roberto Jimenez
de1d7e81a3 Adjusting libtool library numbers to reflect the last changes.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@234 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-06 02:41:34 +00:00
Marcelo Roberto Jimenez
f87dbf8115 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.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@233 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-06 02:29:03 +00:00
Marcelo Roberto Jimenez
83ee32afb7 Added support for rwlocks.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@232 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-06 02:04:38 +00:00
Marcelo Roberto Jimenez
4f960c4e34 Small printf changes. Also reworked PrintThreadPoolStats() so that we can
remove a few #ifdef DEBUG from the main code.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@231 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 13:39:58 +00:00
Marcelo Roberto Jimenez
c85537df11 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@230 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 13:12:35 +00:00
Marcelo Roberto Jimenez
20905cb7a7 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@229 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 13:09:33 +00:00
Marcelo Roberto Jimenez
5b744169d5 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 );



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@228 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 13:07:54 +00:00
Marcelo Roberto Jimenez
c69e16b347 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@227 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 12:25:18 +00:00
Marcelo Roberto Jimenez
cb7e6b7472 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@226 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-11-05 12:06:52 +00:00
Marcelo Roberto Jimenez
fd80e5a8ff Slightly better debug messages and lots of white spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@225 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-10-26 13:21:59 +00:00
Marcelo Roberto Jimenez
b29de32110 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@224 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-09-01 17:05:07 +00:00
Marcelo Roberto Jimenez
6455ac6eea 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.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@223 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-09-01 16:58:58 +00:00
Marcelo Roberto Jimenez
f7bb1f9582 Fixed the path in the documentation for upnpdebug.h.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@222 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-31 13:12:40 +00:00
Marcelo Roberto Jimenez
0728ab3b25 Initialization of the "randomness" struct so that valgrind does not complain.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@221 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-28 14:37:41 +00:00
Marcelo Roberto Jimenez
cb9ee8254c White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@220 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-28 14:08:53 +00:00
Marcelo Roberto Jimenez
f08fdac9b6 ReqBuf was not initialized, so it should not be used.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@219 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-25 02:28:44 +00:00
Marcelo Roberto Jimenez
0db035cc7b Two unnecessary lines.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@218 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-25 01:22:27 +00:00
Marcelo Roberto Jimenez
da11e52924 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@217 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-25 01:20:21 +00:00
Marcelo Roberto Jimenez
bc7b0c9d4d Libtool stuff update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@216 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-06 05:18:25 +00:00
Marcelo Roberto Jimenez
b2757d9d55 Changelog fix.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@215 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-06 05:12:17 +00:00
Marcelo Roberto Jimenez
7967a0cd45 Merge of patch submitted By Keith Brindley - brindlk
SF Bug Tracker [ 1762758 ] Seek not working for large files.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@214 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-06 05:11:07 +00:00
Marcelo Roberto Jimenez
67b51187b9 Merge of Mac OS X patch from Stéphane Corthésy (davelopper),
SF Bug Tracker [ 1686420 ] Modifications for MacOSX.
Some of the proposed changes were already done by Rene Hexel's patch.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@213 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-08-06 02:07:41 +00:00
Marcelo Roberto Jimenez
491f5ffef6 Bumping library version.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@212 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-06-23 14:38:32 +00:00
Marcelo Roberto Jimenez
e4bcf18599 Fix for "make dist".
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@209 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-06-10 19:20:33 +00:00
Marcelo Roberto Jimenez
c856356414 Changelog of the last commit.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@208 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-06-10 03:54:47 +00:00
Marcelo Roberto Jimenez
6acffb7ede 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


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@207 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-06-10 03:54:30 +00:00
Marcelo Roberto Jimenez
837f31bacd Setting properties in tvcombo directory.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@206 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-06-09 13:48:06 +00:00
Marcelo Roberto Jimenez
5151d45203 * [pupnp-devel] NetBSD & Mac OS X packages and patches.
Rene Hexel's <rh@netbsd.org> patch to compile in NetBSD and Mac OS X.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@205 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-06-09 13:40:22 +00:00
Marcelo Roberto Jimenez
114389589d * 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.
* 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.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@204 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-26 15:44:52 +00:00
Marcelo Roberto Jimenez
b817ec5152 * 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.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@203 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-26 05:54:23 +00:00
Marcelo Roberto Jimenez
d9de9a486c * Added support for the Basic Device
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by Titus Winters.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@202 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-26 03:56:25 +00:00
Marcelo Roberto Jimenez
13ebb40e08 Fixed the file libupnp.pc.in to generate a correct path for the
include files.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@201 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-26 01:58:13 +00:00
Marcelo Roberto Jimenez
b614c81e94 Fixed some compiler warings about non void functions reaching the end without
return and some white spaces.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@200 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-25 15:20:19 +00:00
Marcelo Roberto Jimenez
53766465a9 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@199 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-25 15:11:17 +00:00
Marcelo Roberto Jimenez
9bc187d4c6 * Removing the Dbg_Level, InitLog, SetLogFileNames and CloseLog
defines. These were just aliases, no reason to keep them.
* Changed the comments of the include files that expose the UPnP API
to use only C89 comments and no C99 comments.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@198 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-25 15:02:12 +00:00
Nektarios K. Papadopoulos
80517f26a6 * Add ChangLog entry for the tvcombo sample
* Fix a missing -I flag for tvcombo
* Chnage uuid of tvcombo device description to avoid conflicts with tvdevice
sample.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@197 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-24 11:20:01 +00:00
Nektarios K. Papadopoulos
468cb2a908 Create tvcombo sample dir to demonstrate coexistance of device and control
point in the same application. Copied and merged sources from tvdevice and 
tvctrlpt.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@196 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-24 10:32:40 +00:00
Nektarios K. Papadopoulos
d71db4c57c Add ChangeLog entry for the SF Tracker [ 1570020 ] fix.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@195 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-24 10:19:33 +00:00
Nektarios K. Papadopoulos
947dfd9a85 * SF Tracker FR [ 1570020 ].
* Enable both device and control point in the same application. Resolve
deadlock in the SSDP processing threads.
* Fix Threadpool expansion condition.
Thanks to Siva Chandran P. for the original patch.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@194 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-24 10:18:30 +00:00
Nektarios K. Papadopoulos
8f7fd0fc6d * Modified tvdevice (control and picture) service descriptions to make
compatible with WinXP/IE control point. 'in' arguments must appear before
'out' arguments in argument list.
Thanks to Martin Tremblay for pointing out the solution originally
provided by MORIOKA Yasuhiro.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@193 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-24 08:10:28 +00:00
Marcelo Roberto Jimenez
81635d74c1 * More MSVC fixes, using XINLINE instead of inline, MSVC has troubles
with inline. Thanks to David Maass for reporting.
* Changed XINLINE to UPNP_INLINE.
* Lots of white space changes.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@192 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-23 13:20:55 +00:00
Marcelo Roberto Jimenez
d8ba182d85 Adding msvc/inttypes.h to the tarball.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@191 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-23 11:37:11 +00:00
Marcelo Roberto Jimenez
0a41ee988b Moved msvc directory to be under the build directory.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@190 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-23 11:31:13 +00:00
Marcelo Roberto Jimenez
907eb0636a Added the file build/inc/msvc/inttypes.h. This file is for use with
MSVC only, because it does not provide C99 compatibility.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@189 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-21 22:18:28 +00:00
Marcelo Roberto Jimenez
80fc7c3bb0 Some code cleanup.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@188 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-19 02:56:25 +00:00
Marcelo Roberto Jimenez
83fb96fbe2 Removed all uses of the DEVICEONLY(x) macro.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@187 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-19 02:10:02 +00:00
Marcelo Roberto Jimenez
4e1240a0a8 Removing some debug macros missed in the previous commit.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@186 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-18 13:43:09 +00:00
Marcelo Roberto Jimenez
2c1dba2942 - Fixed a bug in UpnpPrintf, function could call va_start() and return
befor calling va_end().

- Removed all uses of the DBGONLY(x) macro. A static inline empty
function now is used and the compiler takes care of optimizing it out.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@185 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-18 13:31:21 +00:00
Marcelo Roberto Jimenez
4ceb6c67d1 * EXPORT_SPEC missing on some declarations in ixml/inc/ixml.h.
Thanks to David Maass.

* sizeof is unsigned, so %zu is more adequate than %zd.

* Using an invented printf directive PRIzu that on MSVC
expands to "lu", and on normal C99 compilers expands to "zu".

* Rewrote raw_find_str. Now it no longer uses strcasestr(), but it
transforms the first input buffer into lowercase.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@184 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-16 02:02:16 +00:00
Marcelo Roberto Jimenez
3fa207984a Moved upnp_tv_ctrlpt and upnp_tv_device executables from folder
upnp to folder upnp/sample. Moved folder upnp/sample/tvdevice/web
to folder upnp/sample/web. This way, if someone compiles the
tarball and executes upnp_tv_device from its creation directory,
there will be no error -108 for not finding directory web.

Also changed svnignore in the process.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@183 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-11 05:00:43 +00:00
Marcelo Roberto Jimenez
b82c9c6009 Added inttypes.h as a header requirement in configure.ac.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@182 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-08 23:45:21 +00:00
Marcelo Roberto Jimenez
b1f6e83380 Fix for debug printf format strings. size_t are not expected.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@181 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-08 23:20:48 +00:00
Marcelo Roberto Jimenez
00a33f5788 Created an svnignore file and used it. Notice that it is not the presence of
this file that changes anything like in cvs. To recursively change the
properties of all directories, you must alter the file and explicitly do:

$ svn propset svn:ignore -F svnignore -R .



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@180 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-04 14:32:51 +00:00
Marcelo Roberto Jimenez
dfec187e88 Trying to start to add Doxygen support.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@179 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-04 14:29:35 +00:00
Marcelo Roberto Jimenez
dee3e96a63 Bumping library version.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@177 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-30 14:43:26 +00:00
Marcelo Roberto Jimenez
23e8160417 Changelog of last modification.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@172 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-30 12:41:45 +00:00
Marcelo Roberto Jimenez
99e11d4fd5 Fix for FreeBSD host_os.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@171 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-30 01:09:21 +00:00
Marcelo Roberto Jimenez
fb4e7f659d Bumping library version.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@170 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-28 19:41:42 +00:00
Marcelo Roberto Jimenez
28799f26c9 [pupnp-devel] Type mixup on x86_64 causes UPNP_E_OUTOF_MEMORY
Submitted By: Glen Masgai
after an UpnpSendActionAsync() for example, i get UPNP_E_OUTOF_MEMORY
in the callback using 1.4.4 on a x86_64 system. This happens in
http_MakeMessage(), which in some cases get called with wrong types
(int instead of size_t) in combination with format "b" and "Q".
The attached patch should fix this.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@166 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-28 18:42:14 +00:00
Marcelo Roberto Jimenez
c1e5e4d6a4 SF Tracker [ 1703533 ] Patch to make it compile under FreeBSD
Submitted By: Timothy Redaelli - drittz
I made some patches to make it compile under FreeBSD using
gethostbyaddr_r when supported.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@165 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-28 17:45:34 +00:00
Marcelo Roberto Jimenez
c0d9908afe Undoing the fix for the fix.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@164 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-27 11:42:26 +00:00
Marcelo Roberto Jimenez
e80cc3ac64 - Fix for Nek's last fix :) Do not enter the loop if NumArgs is zero.
It would loop forever.
- Also strcasestr() is a gnu extension, we need the proper define so that
the prototype is accessable.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@163 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-26 11:40:34 +00:00
Marcelo Roberto Jimenez
e04192e1d0 Removing extra semicolon and Changelog.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@162 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-26 11:14:27 +00:00
Nektarios K. Papadopoulos
bbe85ef599 Fix a bug in makeAction
* upnp/src/api/upnptools.c: Avoid extra call to va_arg after consuming all
      arguments.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@161 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-26 10:05:22 +00:00
Marcelo Roberto Jimenez
5c0893928c Bumping library version for next release.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@159 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-19 13:07:18 +00:00
Marcelo Roberto Jimenez
948c959be5 Case insensitive comparison in raw_find_str() (httpparser.c) as
suggested by Craig Nelson in SF Tracker [ 1689382 ] DLINK DIR-625 patch.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@158 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-19 13:05:33 +00:00
Marcelo Roberto Jimenez
f8c4d81ee5 Version update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@155 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-17 04:00:30 +00:00
Marcelo Roberto Jimenez
286a45d4ad * SF Tracker [ 1652827 ] UpnpRegisterRootDevice returned -104
Submitted By: Michael Andersen - miwer

	Issue was found to be related to sizeof (size_t) != sizeof (int)
	on AMD64 systems. Emil Ljungdahl's AMD64 patch has been applied along
	with some other fixes. Original user report follows:

	When I run upnpd I get the above mentioned error (UPNP_E_OUTOF_MEMORY).
	I've tried with 1.4.1 and 1.4.2-RC3, it's the same. I don't understand why,
	because I have plenty of RAM, and I even tried closing some applications,
	but it didn't help.

	$ upnpd eth1 br0

	The following is logged in the /var/log/messages:
	Feb 6 01:33:47 server upnpd[6933]: Error registering the root device with
	descDocUrl: http://192.168.0.1:49152/gatedesc.xml
	Feb 6 01:33:47 server upnpd[6933]: UpnpRegisterRootDevice returned -104


	I tried enabling debugging and it looks like it cannot allocate memory
	through the membuffer_append function. It's wierd because it's only a few
	bytes.

	Please note, that I enabled some extra debugging lines that were commented,
	in order to get more information. See attached files.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@154 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-17 03:55:20 +00:00
Marcelo Roberto Jimenez
59e0e015be SF Tracker [ 1695399 ] Typo in util.h
Submitted By: Luke Kim - nereusuj
Unix sleep is in seconds but WIN32 Sleep is in milliseconds.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@153 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-04-06 11:22:49 +00:00
Marcelo Roberto Jimenez
bdda54a66b Fix for 64 bit machines.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@152 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-13 17:46:26 +00:00
Marcelo Roberto Jimenez
41cb45146c SF Tracker [ 1663004 ] Compile on Cygwin
Submitted By: Jon Foster - jongfoster
	This patch gives basic support for building under Cygwin - it compiles,
	links, and a simple UPnP device application can initialise. I'm not sure
	if it actually works yet, but this is definitely a step in the right
	direction.
	
	Patch is against the 1.4.1 release. Changes are:
	
	* threadutil/inc/ithread.h: Fix the ithread mutex support to use
	documented, portable APIs (if present) rather than the Non-Portable (_NP)
	ones it uses now. This is required because Cygwin implements only the
	portable API.
	
	* threadutil/src/ThreadPool.c: Fake SetPolicyType() to do nothing on Cygwin
	because otherwise it fails. Should probably investigate why it fails and
	add a proper implementation later.
	
	* upnp/src/api/upnpapi.c: On Cygwin, zero out the GlobalHndMutex structure
	before initialising it. Without this, the initialisation fails. This
	appears to be a bug in Cygwin.
	
	* upnp/src/genlib/net/uri/uri.c: Use gethostbyname() on Cygwin.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@151 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-13 03:27:10 +00:00
Marcelo Roberto Jimenez
2c2a5f7c18 Version number.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@147 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-06 10:30:31 +00:00
Oxy
047b9534bb git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@143 119443c7-1b9e-41f8-b6fc-b9c35fce742c 2007-03-05 13:19:05 +00:00
Marcelo Roberto Jimenez
88076a3c4b Fixed nasty segmentation fault bug on membuffer.c.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@142 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-03 15:01:59 +00:00
Oxy
c3060e0d0b typedef modifications for use with Borland Builder
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@141 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-03 14:36:58 +00:00
Oxy
2ac3819f8c typedefs corrected, made MS VC++ specific to fix problems of that compiler
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@140 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-02 13:53:08 +00:00
Oxy
0d451c9c8e (long long) cast replaced by a generic data type ulong64 that can be defined separately for every used system/compiler (did not work with VC++)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@139 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-03-01 10:08:04 +00:00
Marcelo Roberto Jimenez
bbd16d75ed Not a comment.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@138 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-17 02:18:43 +00:00
Marcelo Roberto Jimenez
a225d3b54e White spaces, reformating.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@132 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-13 13:33:15 +00:00
Marcelo Roberto Jimenez
08834bf0f0 32/64 bits portability issues on *printf.
Use %zd for size_t, and cast to (long long) for off_t.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@129 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-09 19:54:22 +00:00
Oxy
e31fcce11d modified to compile and work under Windows
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@128 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-05 17:31:38 +00:00
Marcelo Roberto Jimenez
dce8f71256 Eric Tanguy's update of spec file.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@126 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-03 17:54:34 +00:00
Marcelo Roberto Jimenez
7a359f29e3 Changes docdir default value. Autoconf's default values does not include
the package version.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@125 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-03 13:52:42 +00:00
Marcelo Roberto Jimenez
ed9a594e73 Use dist-bzip2 to create a .bz2 distribution file.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@124 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-02 04:21:21 +00:00
Marcelo Roberto Jimenez
039b5fdae6 Fixed ChangeLog version.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@123 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-02 04:05:01 +00:00
Marcelo Roberto Jimenez
f07bcb749f * Bumped the program version to 1.4.2 in config.ac.
* Now requires autoconf 2.60.
* Fixed docdir use.
* Does not install the documentation by default.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@122 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-02-02 03:44:55 +00:00
Marcelo Roberto Jimenez
f64c539395 SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2
Submitted By: Jonathan - no_dice
Summary: This patch hopefully fixes the remaining types and related
code to enable files >= 2 GiB to be streamed. Jonathan claims to have
tested this with a patched version of ushare-0.9.8 and a D-Link DSM-520.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@121 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-23 13:22:52 +00:00
Marcelo Roberto Jimenez
cab8e4f799 SF Tracker [ 1628590 ] XML parsing segfault patch
Submitted By: 
Fredrik Svensson - svefredrik

This patch fixes a segmentation fault problem that occurrs when parsing
XML code than some routers produce.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@120 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-09 12:42:41 +00:00
Marcelo Roberto Jimenez
2331839f69 SF Tracker [ 1628629 ] Multicast interface patch
Submitted By: 
Fredrik Svensson - svefredrik

This patch fixes two problems:
* Specify the IP address for the interface when we do setsockopt IP_ADD_MEMBERSHIP. This makes it possible to run when no default router has been configured.
* Explicitly set the multicast interface through setsockopt IP_MULTICAST_IF. Avoids socket error -207 in some cases.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@119 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-09 12:31:17 +00:00
Marcelo Roberto Jimenez
363ac6e007 SF Tracker [ 1628552 ] XML white space patch
Submitted By: 
Fredrik Svensson - svefredrik

Part 2.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@118 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-09 01:18:28 +00:00
Marcelo Roberto Jimenez
5c4e45fb4d SF Tracker [ 1628636 ] SSDP packet copy patch
Submitted By: 
Fredrik Svensson - svefredrik
Summary:
Changed NUM_COPY to 1 since, according to section 9.2 of the HTTPU/MU spec,
we should never send more than one copy of a reply to an SSDP request.

Ref: section 9.2 of http://www.upnp.org/download/draft-goland-http-udp-04.txt



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@117 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-06 20:46:55 +00:00
Marcelo Roberto Jimenez
436bc8fc6d SF Tracker [ 1628575 ] Linksys WRT54G patch
Submitted By: 
Fredrik Svensson - svefredrik



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@116 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-06 19:35:23 +00:00
Marcelo Roberto Jimenez
c6d3d63223 SF Tracker [ 1628562 ] Maximum total jobs patch
Submitted By: 
Fredrik Svensson - svefredrik

Incremented the libray versions and included some comments in the file
configure.ac so that we do not bump the library version excessively,
only the necessary numbers on the next release.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@115 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-06 19:16:12 +00:00
Marcelo Roberto Jimenez
ae7ca6a2cf SF Tracker [ 1628552 ] XML white space patch
Submitted By: 
Fredrik Svensson - svefredrik

A few modifications to the patch were made:
1) Do not introduce new CRLF's where there were none.
2) Applied the same original idea to two other palces in soap_ctrlpt.c.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@114 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-06 14:18:18 +00:00
Marcelo Roberto Jimenez
9595ddcf3a Changelog update and webpage update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@111 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 23:32:05 +00:00
Marcelo Roberto Jimenez
fd19d54144 Finished const-ifications as suggested by Erik Johansson in
SF Patch tracker [ 1587272 ].


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@109 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 22:43:32 +00:00
Marcelo Roberto Jimenez
17db87ab96 Changelog update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@107 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:37:08 +00:00
Marcelo Roberto Jimenez
3b12ced1f8 SF Patch tracker [ 1587272 ] const-ified ixml
Submitted By: Erik Johansson



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@105 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:30:32 +00:00
Marcelo Roberto Jimenez
4abbd5a8a4 SF Patch tracker [ 1581161 ] VStudio2005 patch
Submitted By:
David Maass - darkservant


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@103 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:05:50 +00:00
Marcelo Roberto Jimenez
836069f43b Changelog update.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@101 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 20:37:46 +00:00
Marcelo Roberto Jimenez
353a876a54 SF Bug Tracker [ 1590466 ] Invalid xml output
Submitted By:
Erik Johansson - erijo


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@99 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 20:04:20 +00:00
Marcelo Roberto Jimenez
2bc6a1f8dd SF Bug tracker [ 1590469 ]
Typo in ixmlparser.c
Submitted By:
Erik Johansson - erijo


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@97 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 19:54:01 +00:00
Marcelo Roberto Jimenez
1d9e8712b7 Thorough revision of every call of http_MakeMessage() due to a bug introduced
in rev.79: largefile patch added.

http_MakeMessage() has a worst than brain damaged "printf" like interface.
In rev.79, the "N" format parameter must be an off_t. Every call of this
function with an "N" format parameter and an int passed on the stack 
would fail terribly.

Not every place I touched had a bug, but to review the format and keep my
sanity, I had to format it properly.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@96 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 18:38:00 +00:00
Nektarios K. Papadopoulos
819ad1f365 [bug-id] 1580440
[submitted-by] Erik Johansson - erijo
[patched-by] Erik Johansson - erijo

The SOAP HTTP message that's generated on upnp errors
is missing a \r\n\ between header and body.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@95 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-10-19 12:42:17 +00:00
Nektarios K. Papadopoulos
e9e8ea5636 Revert commenting out definition of STATS. Otherwise compilation with debug is broken.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@90 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-10-09 13:42:09 +00:00
Nektarios K. Papadopoulos
14f72e1442 Always retrieve the actual port used by the library. Even if specified the value might be
invalid (e.g. < 49152)  or unavailable.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@88 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-10-03 10:26:31 +00:00
Oxy
ae13c481a7 git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@87 119443c7-1b9e-41f8-b6fc-b9c35fce742c 2006-09-28 17:20:22 +00:00
Nektarios K. Papadopoulos
38a91fdaec Applied patch from issue 12, reported by vinvin.
Two calls to http_MakeMessage were broken from large
file support introduced in r79


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@86 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-09-21 07:57:35 +00:00
Oxy
87f336c940 Leuk_he added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@85 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-22 06:07:22 +00:00
Oxy
74d2b0049b Windows-specific code for error threating added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@84 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-21 05:03:28 +00:00
Oxy
635d6ffa93 largefile modification adapted for Windows port
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@83 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:31:55 +00:00
Oxy
8c56f16607 largefile patch added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@82 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:19:03 +00:00
Oxy
5d3ef166c1 largefile patch added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@81 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:18:45 +00:00
Oxy
a4072c19b1 largefile patch added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@80 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:18:28 +00:00
Oxy
1716c7a10d largefile patch added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@79 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:17:50 +00:00
Oxy
83782e8ae2 largefile patch added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@78 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:16:50 +00:00
Oxy
f1cc7db79d largefile patch added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@77 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-17 05:16:23 +00:00
Oxy
e69d5a8609 workaround for Linux-applications that do not catch SIGPIPE backported
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@76 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-07 05:49:19 +00:00
Oxy
16637892e3 workaround added for applications that don't catch SIGEPIPE
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@75 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-04 05:46:06 +00:00
Oxy
d19a57c866 problem with datatype on x86_64 platform fixed
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@74 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-08-03 19:51:59 +00:00
Oxy
8c21b2c4d9 Windows-port: some special code and switches for statical libraries added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@73 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-31 05:32:33 +00:00
Nektarios K. Papadopoulos
736efca5dd Fix issue reported by Siva Chandran P
strlen returns size_t which is long or int depending on the platform. 
We use %ld in printf and cast the return value to long.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@71 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-26 13:48:36 +00:00
Nektarios K. Papadopoulos
d5449dc948 Fix issues reported by Siva Chandran P
Replace function wide STSONLY macros with ifdef STATS.
Remove %lf format modifiers


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@70 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-26 13:43:23 +00:00
Nektarios K. Papadopoulos
7c49b3b8a4 Fix bug ID 0000006 reported by leuk_he
Remove check for NumArg > 0. Always call va_start, va_end.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@69 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-26 13:37:40 +00:00
Nektarios K. Papadopoulos
5c03ebe6e1 Fixed missing comma, spotted by darkservant.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@68 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-25 10:58:53 +00:00
Nektarios K. Papadopoulos
d17eb5fcfc Fix bug ID 0000004 reported by darkservant.
Missing X_USER_AGENT parameter for "Xc" fmt (i.e. HTTP X-User-Agent header).


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@67 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-25 06:26:15 +00:00
Oxy
8625298899 building instructions for solaris added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@64 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 06:07:53 +00:00
Oxy
864d3db0ad credits added
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@63 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 06:02:13 +00:00
Nektarios K. Papadopoulos
1d4d1ff87e Add minimum building instruction for Win32 platform.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@62 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 04:53:29 +00:00
Nektarios K. Papadopoulos
a26769b27b Win32 build:
Changed absolute paths to relative.
pthreads-w32 Pre-built.2 directory contents are expected under pthreads.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@61 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 04:52:39 +00:00
Marcelo Roberto Jimenez
fbbec55457 Fixing Makefile.am to add missing files for windows build.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@58 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-20 02:43:21 +00:00
Oxy
8245b0d808 email addresses modified to hide them from spambots (in SVNWeb)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@57 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-18 06:39:45 +00:00
Marcelo Roberto Jimenez
815d08420a npapadop's patch for including pdf docs in the devel package instead of the non-devel.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@54 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-11 00:51:53 +00:00
Oxy
1d0ce01f31 check for malloc.h removed - not possible for FreeBSD and not really needed for Linux
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@52 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-09 16:52:20 +00:00
Marcelo Roberto Jimenez
947896bcee - Added a spec file to the tar ball, thanks to Eric Tanguy.
Generating an rpm now is as easy as:
$ rpmbuild -ta libupnp-1.4.1.tar.gz

- Added Eric's name to the THANKS file and sorted it in
ascending first name order.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@50 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-08 13:16:18 +00:00
Oxy
7ed934d858 contributor list updated
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@48 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-07 07:16:58 +00:00
Oxy
4a7708331c changes for compilation with MS VC++
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@47 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-07 07:01:43 +00:00
Oxy
ab66940a89 changes for compilation with MS VC++
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@46 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-07 06:58:19 +00:00
Nektarios K. Papadopoulos
ebac5fe596 Include prebuilt documentation (html,pdf), dropping doc++ dependancy.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@45 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-06 12:37:29 +00:00
Oxy
11de68d0e3 git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@44 119443c7-1b9e-41f8-b6fc-b9c35fce742c 2006-07-05 16:31:02 +00:00
Oxy
dfe3071af4 git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@43 119443c7-1b9e-41f8-b6fc-b9c35fce742c 2006-07-05 16:29:17 +00:00
Oxy
cd50cb678f define removed
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@42 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-05 16:18:26 +00:00
Marcelo Roberto Jimenez
f13fd3d522 Preparing configure.ac for next release.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@41 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-05 02:56:34 +00:00
Oxy
927b86545f some minor modificationsto compile with Borland Builder
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@40 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 18:10:52 +00:00
Oxy
a155612cba some minor modificationsto compile with Borland Builder
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@39 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 18:10:02 +00:00
Oxy
df3df9eaed some minor modificationsto compile with Borland Builder
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@38 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 18:09:36 +00:00
Oxy
eefeb86a96 some minor modificationsto compile with Borland Builder
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@37 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 16:44:42 +00:00
Oxy
0452011b99 Bornalnd C++ Builder 5 project files
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@36 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 16:36:20 +00:00
Marcelo Roberto Jimenez
a20707485d Creation of docs directory under trunk.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@35 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 12:30:51 +00:00
Nektarios K. Papadopoulos
ec86a6f92b Fix wrong function name in documentation comment block for UpnpSearchAsync.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@33 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 09:03:21 +00:00
Marcelo Roberto Jimenez
89e7a40fcc Removing unnecessary additional directory level.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@29 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 02:44:17 +00:00
Marcelo Roberto Jimenez
90c3db2a96 Patch for FreeBSD, thanks to Markus Strobl.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@28 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-03 14:02:29 +00:00
Marcelo Roberto Jimenez
cf9ae4f6e5 npapadop's patch to fix duplicated lines.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@27 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-30 12:52:33 +00:00
Marcelo Roberto Jimenez
f28f81f820 Fix for missing else in httpreadwrite.c.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@26 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-27 21:40:30 +00:00
Marcelo Roberto Jimenez
bcaba51f57 Changelog.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@25 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-27 10:41:03 +00:00
Marcelo Roberto Jimenez
4c5b61dc55 Fix for va_list compilation in x86_64.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@24 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-26 14:27:53 +00:00
Oxy
9147c3517e modified to compile under Windows with WIN32 switch and to export DLL-symbols
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@23 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 12:56:37 +00:00
Oxy
cbefc2ff49 type identifier changed for GCC
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@22 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 12:38:29 +00:00
Oxy
863e743c41 modified to compile under Windows with WIN32 switch and to export DLL-symbols
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@21 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 12:34:29 +00:00
Oxy
26bde09028 files required for Windows variant only
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@20 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 12:34:04 +00:00
Oxy
bc2941c2a7 modified to compile under Windows with WIN32 switch
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@19 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 10:07:07 +00:00
Oxy
40186d3e9c files required for Windows variant only
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@18 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 10:06:35 +00:00
Oxy
01d26f8f74 files required for Windows variant
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@17 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-13 10:04:24 +00:00
Oxy
b2cb458ee3 empty doc replaced
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@16 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-12 06:48:32 +00:00
Oxy
16da6980d1 several memory leaks and potential reasons for a crash removed (thanks to loigu)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@15 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-08 07:03:30 +00:00
Oxy
211973749c several memory leaks and potential reasons for a crash removed (thanks to loigu)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@14 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-08 07:00:39 +00:00
Oxy
a22ba2f159 several memory leaks and potential reasons for a crash removed (thanks to loigu)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@13 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-08 06:57:46 +00:00
Oxy
142929623d several memory leaks and potential reasons for a crash removed (thanks to loigu)
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@12 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-08 06:41:00 +00:00
Marcelo Roberto Jimenez
3170fbd730 Make bootstrap executable.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@6 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-06-06 16:36:09 +00:00
48 changed files with 1802 additions and 1187 deletions

176
ChangeLog
View File

@@ -1,7 +1,121 @@
*******************************************************************************
Version 1.4.7
Version 1.6.1
*******************************************************************************
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>
* Added support for the Basic Device
(http://www.upnp.org/standardizeddcps/basic.asp) as suggested by
@@ -364,14 +478,14 @@ Version 1.4.0
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
* upnp/src/gena/gena_device.c (respond_ok): add 'Content-Length: 0'
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
the one in libupnp-doc-1.2.1 because current CVS version
@@ -382,20 +496,20 @@ FORK FROM DEAD libupnp
* changes applied to several files to work under Sparc Solaris, temporarily
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
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
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
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
CDATA sections which contain a 0 (zero) to be parsed (instead the
@@ -406,18 +520,18 @@ FORK FROM DEAD libupnp
option, and move samples compilation from check_PROGRAMS to
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):
fix bug if new socket created has fd 0 (can only occur when stdin
has been closed). Patch by Oskar Liljeblad 2004-07-02 :
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
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
@@ -432,11 +546,11 @@ FORK FROM DEAD libupnp
dependencies between upnp and ixml / threadutil, so that programs
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
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
package version string from configure to set sdk info
@@ -444,7 +558,7 @@ FORK FROM DEAD libupnp
* upnp/Makefile.am: add sample/tvdevice/web/ files in EXTRA_DIST
+ 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_HAVE_xx instead of INCLUDE_yyy_APIS and INTERNAL_WEB_SERVER
@@ -453,7 +567,7 @@ FORK FROM DEAD libupnp
the librarie LDFLAGS in order to export only the symbols defined
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
@@ -461,7 +575,7 @@ FORK FROM DEAD libupnp
* 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
to "iasnprintf"
@@ -482,11 +596,11 @@ FORK FROM DEAD libupnp
the configuration of the installed libraries (generates installed
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
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
exported into "upnp/src/inc/util.h"
@@ -494,12 +608,12 @@ FORK FROM DEAD libupnp
* import all modifications below from libupnp in djmount 0.51
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
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
@@ -519,53 +633,53 @@ FORK FROM DEAD libupnp
* ixml/src/node.c (ixmlNode_getNodeType): fix compilation warning
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
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/src/inc/httpreadwrite.h: remove internal configuration variable
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,
for binary compatibility with previous libupnp version.
* 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
for automake support, + preliminary autoconf support
(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/sample/tvctrlpt/linux/Makefile,
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
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/ixmlparser.h, ixml/src/ixmlparser.c (Parser_setErrorChar) :
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
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):
remove some compilation warning
@@ -576,7 +690,7 @@ FORK FROM DEAD libupnp
* upnp/inc/upnptools.h, upnp/src/api/upnptools.c :
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)
and replace by DEFAULT_SOAP_CONTENT_LENGTH (previously in upnpapi.h)
@@ -597,7 +711,7 @@ FORK FROM DEAD libupnp
* upnp/src/genlib/net/http/httpreadwrite.c : corrected an incorrect
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,
ixml/Makefile, ixml/src/Makefile,
@@ -605,7 +719,7 @@ FORK FROM DEAD libupnp
implement STATIC library support (from patch at
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/soap/makefile :

View File

@@ -1,8 +1,7 @@
#
# 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

2
README
View File

@@ -1,7 +1,7 @@
Portable SDK for UPnP* Devices (libupnp)
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>
See LICENSE for details.

7
THANKS
View File

@@ -6,7 +6,9 @@ suggesting various improvements or submitting actual code.
Here is a list of these people. Help us keep it complete and
exempt of errors.
- Alex (afaucher)
- Arno Willig
- Bob Ciora
- Chaos
- Craig Nelson
- David Maass
@@ -19,16 +21,19 @@ exempt of errors.
- Jiri Zouhar
- John Dennis
- Jonathan (no_dice)
- Keith Brindley
- Leuk_He
- Loigu
- Luke Kim
- Marcelo Roberto Jimenez
- Marcelo Roberto Jimenez (mroberto)
- Markus Strobl
- Nektarios K. Papadopoulos
- Oskar Liljeblad
- Michael (Oxy)
- Paul Vixie
- Rene Hexel
- Siva Chandran
- Stéphane Corthésy
- Timothy Redaelli
- Titus Winters

View File

@@ -261,7 +261,7 @@
/** @name Other debugging features
The UPnP SDK contains other features to aid in debugging:
see <upnp/upnpdebug.h>
see <upnp/inc/upnpdebug.h>
*/
#define DEBUG_ALL 1

View File

@@ -2,7 +2,7 @@
// -*- C -*-
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
// Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without

View File

@@ -5,17 +5,17 @@
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=libupnp - Win32 Debug
!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 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
!MESSAGE NMAKE /f "libupnp.mak".
!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
!MESSAGE NMAKE /f "libupnp.mak" CFG="libupnp - Win32 Debug"
!MESSAGE
!MESSAGE F<>r die Konfiguration stehen zur Auswahl:
!MESSAGE F<>r die Konfiguration stehen zur Auswahl:
!MESSAGE
!MESSAGE "libupnp - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE "libupnp - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")

View File

@@ -4,14 +4,15 @@
#
# Process this file with autoconf to produce a configure script.
#
# (C) Copyright 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net>
# (C) Copyright 2005-2007 R<>mi Turboult <r3mi@users.sourceforge.net>
#
AC_PREREQ(2.60)
AC_INIT([libupnp], [1.4.7], [mroberto@users.sourceforge.net])
AC_INIT([libupnp], [1.6.1], [mroberto@users.sourceforge.net])
###############################################################################
# *Independently* of the above libupnp package version, the libtool version
# of the 3 libraries need to be updated whenever there is a change released :
# of the 3 libraries need to be updated whenever there is a change released:
# "current:revision:age" (this is NOT the same as the package version), where:
# - library code modified: revision++
# - interfaces changed/added/removed: current++ and revision=0
@@ -19,11 +20,14 @@ AC_INIT([libupnp], [1.4.7], [mroberto@users.sourceforge.net])
# - interfaces removed: age=0
# *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_THREADUTIL], [2:2:0])
#AC_SUBST([LT_VERSION_UPNP], [2:2:0])
#
###############################################################################
# Release 1.4.6:
# "current:revision:age"
#
# - Code has changed in ixml
@@ -34,19 +38,73 @@ AC_INIT([libupnp], [1.4.7], [mroberto@users.sourceforge.net])
# current: 2 -> 3
# revisiion: 3 -> 0
# age: 0 -> 1
# - Code has changed in upnp (revision 2 -> 3)
# - Code has changed in upnp
# revision: 2 -> 3
AC_SUBST([LT_VERSION_IXML], [2:3:0])
AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
AC_SUBST([LT_VERSION_UPNP], [2:3:0])
#
#AC_SUBST([LT_VERSION_IXML], [2:3:0])
#AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1])
#AC_SUBST([LT_VERSION_UPNP], [2:3:0])
#
###############################################################################
# Release 1.6.0:
# "current:revision:age"
#
# - Code has changed in ixml
# revision: 3 -> 4
# - Code has changed in threadutil
# revision: 0 -> 1
# - Code has changed in upnp
# revision: 3 -> 4
# - Interface changed in upnp
# current: 2 -> 3
# revision: 4 -> 0
# - Interface removed in upnp
# age: 0 -> 0
#
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
#AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1])
#AC_SUBST([LT_VERSION_UPNP], [3:0:0])
#
###############################################################################
# Release 1.6.1:
# "current:revision:age"
#
# - Code has changed in threadutil
# revision: 1 -> 2
# - Interface added in threadutil
# current: 3 -> 4
# revision: 2 -> 0
# - Interface added in threadutil
# age: 1 -> 2
# - Code has changed in upnp
# revision: 0 -> 1
#
#AC_SUBST([LT_VERSION_IXML], [2:4:0])
#AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2])
#AC_SUBST([LT_VERSION_UPNP], [3:1:0])
#
###############################################################################
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_MACRO_DIR(m4)
AC_CONFIG_SRCDIR(upnp/inc/upnp.h)
AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2])
#
# Get canonical host names in host and host_os
#

View File

@@ -9,4 +9,3 @@ Version: @VERSION@
Libs: @PTHREAD_LIBS@ -L${libdir} -lupnp -lthreadutil -lixml
Cflags: @PTHREAD_CFLAGS@ -I${includedir}/upnp

View File

@@ -1,4 +1,4 @@
Version: 1.4.7
Version: 1.4.2
Summary: Universal Plug and Play (UPnP) SDK
Name: libupnp
Release: 1%{?dist}
@@ -77,9 +77,6 @@ make install DESTDIR=$RPM_BUILD_ROOT
rm -rf %{buildroot}
%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
- Update to version 1.4.2

View File

@@ -1,50 +1,88 @@
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
dnl
dnl @summary figure out how to build C programs using POSIX threads
dnl
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
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
dnl compiler flags/libs to be tested by setting these environment
dnl variables.)
dnl
dnl Also sets PTHREAD_CC to any special C compiler that is needed for
dnl multi-threaded programs (defaults to the value of CC otherwise).
dnl (This is necessary on AIX to use the special cc_r compiler alias.)
dnl
dnl 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 with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
dnl $LIBS
dnl
dnl If you are only building threads programs, you may wish to use
dnl these variables in your default LIBS, CFLAGS, and CC:
dnl
dnl LIBS="$PTHREAD_LIBS $LIBS"
dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
dnl CC="$PTHREAD_CC"
dnl
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
dnl
dnl 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 run it if it is not found. If ACTION-IF-FOUND is not specified, the
dnl default action will define HAVE_PTHREAD.
dnl
dnl Please let the authors know if this macro fails on any platform, or
dnl if you have any other suggestions or comments. This macro was based
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
dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
dnl We are also grateful for the helpful feedback of numerous users.
dnl
dnl @category InstalledPackages
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
dnl @version 2005-06-15
dnl @license GPLWithACException
##### http://autoconf-archive.cryp.to/acx_pthread.html
#
# SYNOPSIS
#
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads.
# It sets the PTHREAD_LIBS output variable to the threads library and
# linker flags, and the PTHREAD_CFLAGS output variable to any special
# C compiler flags that are needed. (The user can also force certain
# compiler flags/libs to be tested by setting these environment
# variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise).
# (This is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these
# flags, but also link it with them as well. e.g. you should link
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
# $LIBS
#
# If you are only building threads programs, you may wish to use
# these variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
# default action will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or
# if you have any other suggestions or comments. This macro was based
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
# macros posted by Alejandro Forero Cuervo to the autoconf macro
# repository. We are also grateful for the helpful feedback of
# numerous users.
#
# 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_REQUIRE([AC_CANONICAL_HOST])
@@ -216,8 +254,12 @@ if test "x$acx_pthread_ok" = xyes; then
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
# More AIX lossage: must compile with xlc_r or cc_r
if test x"$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi

View File

@@ -1,48 +1,87 @@
dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
dnl
dnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
dnl "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
dnl optionflag to CFLAGS if it is understood. You can override the
dnl shellvar-default of CFLAGS of course. The order of arguments stems
dnl from the explicit macros like AX_CFLAGS_WARN_ALL.
dnl
dnl The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
dnl to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
dnl (since it is possible to use different compilers for C and C++).
dnl
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.
dnl However, if you use this macro in a few places, it would be great
dnl if you would make up a new function-macro and submit it to the
dnl ac-archive.
dnl
dnl - $1 option-to-check-for : required ("-option" as non-value)
dnl - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
dnl - $3 action-if-found : add value to shellvariable
dnl - $4 action-if-not-found : nothing
dnl
dnl note: in earlier versions, $1-$2 were swapped. We try to detect the
dnl situation and accept a $2=~/-/ as being the old
dnl option-to-check-for.
dnl
dnl also: there are other variants that emerged from the original macro
dnl variant which did just test an option to be possibly added.
dnl However, some compilers accept an option silently, or possibly for
dnl just another option that was not intended. Therefore, we have to do
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
dnl to be compatible with gcc even when not being made from gcc
dnl sources.
dnl
dnl see also:
dnl
dnl AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
dnl AX_CFLAGS_AIX_OPTION AX_CFLAGS_IRIX_OPTION
dnl
dnl @category C
dnl @author Guido Draheim <guidod@gmx.de>
dnl @version 2003-11-04
dnl @license GPLWithACException
##### http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
#
# SYNOPSIS
#
# AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])
#
# DESCRIPTION
#
# AX_CFLAGS_GCC_OPTION(-fvomit-frame) would show a message as like
# "checking CFLAGS for gcc -fvomit-frame ... yes" and adds the
# optionflag to CFLAGS if it is understood. You can override the
# shellvar-default of CFLAGS of course. The order of arguments stems
# from the explicit macros like AX_CFLAGS_WARN_ALL.
#
# The cousin AX_CXXFLAGS_GCC_OPTION would check for an option to add
# to CXXFLAGS - and it uses the autoconf setup for C++ instead of C
# (since it is possible to use different compilers for C and C++).
#
# The macro is a lot simpler than any special AX_CFLAGS_* macro (or
# ac_cxx_rtti.m4 macro) but allows to check for arbitrary options.
# However, if you use this macro in a few places, it would be great
# if you would make up a new function-macro and submit it to the
# ac-archive.
#
# - $1 option-to-check-for : required ("-option" as non-value)
# - $2 shell-variable-to-add-to : CFLAGS (or CXXFLAGS in the other case)
# - $3 action-if-found : add value to shellvariable
# - $4 action-if-not-found : nothing
#
# note: in earlier versions, $1-$2 were swapped. We try to detect the
# situation and accept a $2=~/-/ as being the old
# option-to-check-for.
#
# also: there are other variants that emerged from the original macro
# variant which did just test an option to be possibly added.
# However, some compilers accept an option silently, or possibly for
# just another option that was not intended. Therefore, we have to do
# a generic test for a compiler family. For gcc we check "-pedantic"
# being accepted which is also understood by compilers who just want
# to be compatible with gcc even when not being made from gcc
# sources.
#
# see also:
#
# AX_CFLAGS_SUN_OPTION AX_CFLAGS_HPUX_OPTION
# 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
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
@@ -53,7 +92,8 @@ VAR,[VAR="no, unknown"
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
in "-pedantic -Werror % 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,%,,'`
AC_TRY_COMPILE([],[return 0;],
@@ -85,10 +125,11 @@ 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)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
AC_LANG_CPLUSPLUS
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($2,$2,-option)" dnl GCC
in "-pedantic -Werror % 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,%,,'`
AC_TRY_COMPILE([],[return 0;],
@@ -122,7 +163,8 @@ VAR,[VAR="no, unknown"
AC_LANG_C
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
in "-pedantic -Werror % 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,%,,'`
AC_TRY_COMPILE([],[return 0;],
@@ -154,10 +196,11 @@ 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)],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
AC_LANG_CPLUSPLUS
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % m4_ifval($1,$1,-option)" dnl GCC
in "-pedantic -Werror % 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,%,,'`
AC_TRY_COMPILE([],[return 0;],

View File

@@ -1,27 +1,66 @@
dnl @synopsis AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
dnl
dnl Try to find a compiler option that enables most reasonable
dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
dnl which is split up into two AX_CFLAGS_WARN_ALL and
dnl AX_CFLAGS_WARN_ALL_ANSI
dnl
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
dnl result is added to the shellvar being CFLAGS by default.
dnl
dnl Currently this macro knows about GCC, Solaris C compiler, Digital
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
dnl 10.0.0.8) C compiler.
dnl
dnl - $1 shell-variable-to-add-to : CFLAGS
dnl - $2 add-value-if-not-found : nothing
dnl - $3 action-if-found : add value to shellvariable
dnl - $4 action-if-not-found : nothing
dnl
dnl @category C
dnl @author Guido Draheim <guidod@gmx.de>
dnl @version 2003-01-06
dnl @license GPLWithACException
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all.html
#
# SYNOPSIS
#
# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
#
# DESCRIPTION
#
# Try to find a compiler option that enables most reasonable
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
# which is split up into two AX_CFLAGS_WARN_ALL and
# AX_CFLAGS_WARN_ALL_ANSI
#
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
# result is added to the shellvar being CFLAGS by default.
#
# Currently this macro knows about GCC, Solaris C compiler, Digital
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
# 10.0.0.8) C compiler.
#
# - $1 shell-variable-to-add-to : CFLAGS
# - $2 add-value-if-not-found : nothing
# - $3 action-if-found : add value to shellvariable
# - $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
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
@@ -72,7 +111,7 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
AC_LANG_CPLUSPLUS
ac_save_[]FLAGS="$[]FLAGS"
for ac_arg dnl
in "-pedantic % -Wall" dnl GCC
@@ -115,4 +154,5 @@ dnl compilers will fail about it. That was needed since a lot of
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 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.

View File

@@ -1,27 +1,66 @@
dnl @synopsis AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
dnl
dnl Try to find a compiler option that enables most reasonable
dnl warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
dnl which is split up into two AX_CFLAGS_WARN_ALL and
dnl AX_CFLAGS_WARN_ALL_ANSI
dnl
dnl For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
dnl result is added to the shellvar being CFLAGS by default.
dnl
dnl Currently this macro knows about GCC, Solaris C compiler, Digital
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
dnl 10.0.0.8) C compiler.
dnl
dnl - $1 shell-variable-to-add-to : CFLAGS
dnl - $2 add-value-if-not-found : nothing
dnl - $3 action-if-found : add value to shellvariable
dnl - $4 action-if-not-found : nothing
dnl
dnl @category C
dnl @author Guido Draheim <guidod@gmx.de>
dnl @version 2003-01-06
dnl @license GPLWithACException
##### http://autoconf-archive.cryp.to/ax_cflags_warn_all_ansi.html
#
# SYNOPSIS
#
# AX_CFLAGS_WARN_ALL_ANSI [(shellvar [,default, [A/NA]])]
#
# DESCRIPTION
#
# Try to find a compiler option that enables most reasonable
# warnings. This macro is directly derived from VL_PROG_CC_WARNINGS
# which is split up into two AX_CFLAGS_WARN_ALL and
# AX_CFLAGS_WARN_ALL_ANSI
#
# For the GNU CC compiler it will be -Wall (and -ansi -pedantic) The
# result is added to the shellvar being CFLAGS by default.
#
# Currently this macro knows about GCC, Solaris C compiler, Digital
# Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
# compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
# 10.0.0.8) C compiler.
#
# - $1 shell-variable-to-add-to : CFLAGS
# - $2 add-value-if-not-found : nothing
# - $3 action-if-found : add value to shellvariable
# - $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
AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
@@ -77,7 +116,7 @@ AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_warn_all_ansi])dnl
AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum ansi warnings],
VAR,[VAR="no, unknown"
AC_LANG_SAVE
AC_LANG_CXX
AC_LANG_CPLUSPLUS
ac_save_[]FLAGS="$[]FLAGS"
# IRIX C compiler:
# -use_readonly_const is the default for IRIX C,

View File

@@ -1,13 +1,52 @@
dnl @synopsis TYPE_SOCKLEN_T
dnl
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
dnl can be compiled.
dnl
dnl @category Misc
dnl @author Lars Brinkhoff <lars@nocrew.org>
dnl @version 2005-01-11
dnl @license GPLWithACException
##### http://autoconf-archive.cryp.to/type_socklen_t.html
#
# SYNOPSIS
#
# TYPE_SOCKLEN_T
#
# DESCRIPTION
#
# Check whether sys/socket.h defines type socklen_t. Please note that
# some systems require sys/types.h to be included before sys/socket.h
# 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_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,

View File

@@ -547,6 +547,10 @@ int TPAttrSetMaxJobsTotal(ThreadPoolAttr *attr, int maxJobsTotal);
EXPORT int ThreadPoolGetStats(ThreadPool *tp, 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
#ifdef __cplusplus

View File

@@ -42,131 +42,158 @@ extern "C" {
#endif
#ifdef __FreeBSD__
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif
#ifdef PTHREAD_MUTEX_RECURSIVE
/* This system has SuS2-compliant mutex attributes.
* 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_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
#else
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
#endif
/* This system has SuS2-compliant mutex attributes.
* 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_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK
#else /* PTHREAD_MUTEX_RECURSIVE */
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
#define ITHREAD_MUTEX_ERRORCHECK_NP PTHREAD_MUTEX_ERRORCHECK_NP
#endif /* PTHREAD_MUTEX_RECURSIVE */
#define ITHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
#define ITHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
#define ITHREAD_CANCELED PTHREAD_CANCELED
/***************************************************************************
* Name: ithread_t
*
* Description:
* Thread handle.
* typedef to pthread_t.
* Internal Use Only.
***************************************************************************/
typedef pthread_t ithread_t;
/***************************************************************************
* Name: ithread_t
*
* Description:
* Thread handle.
* typedef to pthread_t.
* Internal Use Only.
***************************************************************************/
typedef pthread_t ithread_t;
/****************************************************************************
* Name: ithread_attr_t
*
* Description:
* Thread attribute.
* typedef to pthread_attr_t
* Internal Use Only
***************************************************************************/
typedef pthread_attr_t ithread_attr_t;
/****************************************************************************
* Name: ithread_attr_t
*
* Description:
* Thread attribute.
* typedef to pthread_attr_t
* Internal Use Only
***************************************************************************/
typedef pthread_attr_t ithread_attr_t;
/****************************************************************************
* Name: start_routine
*
* Description:
* Thread start routine
* Internal Use Only.
***************************************************************************/
typedef void * (*start_routine) (void *arg);
/****************************************************************************
* Name: start_routine
*
* Description:
* Thread start routine
* Internal Use Only.
***************************************************************************/
typedef void * (*start_routine) (void *arg);
/****************************************************************************
* Name: ithread_cond_t
*
* Description:
* condition variable.
* typedef to pthread_cond_t
* Internal Use Only.
***************************************************************************/
typedef pthread_cond_t ithread_cond_t;
/****************************************************************************
* Name: ithread_cond_t
*
* Description:
* condition variable.
* typedef to pthread_cond_t
* Internal Use Only.
***************************************************************************/
typedef pthread_cond_t ithread_cond_t;
/****************************************************************************
* Name: ithread_mutexattr_t
*
* Description:
* Mutex attribute.
* typedef to pthread_mutexattr_t
* Internal Use Only
***************************************************************************/
typedef pthread_mutexattr_t ithread_mutexattr_t;
/****************************************************************************
* Name: ithread_mutexattr_t
*
* Description:
* Mutex attribute.
* typedef to pthread_mutexattr_t
* Internal Use Only
***************************************************************************/
typedef pthread_mutexattr_t ithread_mutexattr_t;
/****************************************************************************
* Name: ithread_mutex_t
*
* Description:
* Mutex.
* typedef to pthread_mutex_t
* Internal Use Only.
***************************************************************************/
typedef pthread_mutex_t ithread_mutex_t;
/****************************************************************************
* Name: ithread_mutex_t
*
* Description:
* Mutex.
* typedef to pthread_mutex_t
* Internal Use Only.
***************************************************************************/
typedef pthread_mutex_t ithread_mutex_t;
/****************************************************************************
* Name: ithread_condattr_t
*
* Description:
* Condition attribute.
* typedef to pthread_condattr_t
* NOT USED
* Internal Use Only
***************************************************************************/
typedef pthread_condattr_t ithread_condattr_t;
/****************************************************************************
* Name: ithread_condattr_t
*
* Description:
* Condition attribute.
* typedef to pthread_condattr_t
* NOT USED
* Internal Use Only
***************************************************************************/
typedef pthread_condattr_t ithread_condattr_t;
/****************************************************************************
* Function: ithread_mutexattr_init
*
* Description:
* Initializes a mutex attribute variable.
* Used to set the type of the mutex.
* Parameters:
* ithread_mutexattr_init * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_mutexattr_init
***************************************************************************/
/****************************************************************************
* 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
*
* Description:
* Initializes a mutex attribute variable.
* Used to set the type of the mutex.
* Parameters:
* ithread_mutexattr_init * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_mutexattr_init
***************************************************************************/
#define ithread_mutexattr_init pthread_mutexattr_init
/****************************************************************************
* Function: ithread_mutexattr_destroy
*
* Description:
* Releases any resources held by the mutex attribute.
* Currently there are no resources associated with the attribute
* Parameters:
* ithread_mutexattr_t * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_mutexattr_destroy
***************************************************************************/
/****************************************************************************
* Function: ithread_mutexattr_destroy
*
* Description:
* Releases any resources held by the mutex attribute.
* Currently there are no resources associated with the attribute
* Parameters:
* ithread_mutexattr_t * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* Returns:
* 0 on success, Nonzero on failure.
* Always returns 0.
* See man page for pthread_mutexattr_destroy
***************************************************************************/
#define ithread_mutexattr_destroy pthread_mutexattr_destroy
@@ -180,7 +207,7 @@ extern "C" {
* ITHREAD_MUTEX_ERRORCHECK_NP
*
* Parameters:
* ithread_mutexattr_t * mutex (must be valid non NULL pointer to
* ithread_mutexattr_t * attr (must be valid non NULL pointer to
* ithread_mutexattr_t)
* int kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
* or ITHREAD_MUTEX_ERRORCHECK_NP)
@@ -190,9 +217,9 @@ extern "C" {
* See man page for pthread_mutexattr_setkind_np
*****************************************************************************/
#ifdef PTHREAD_MUTEX_RECURSIVE
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
#else
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
#endif
/****************************************************************************
@@ -205,7 +232,7 @@ extern "C" {
* ITHREAD_MUTEX_ERRORCHECK_NP
*
* Parameters:
* ithread_mutexattr_t * mutex (must be valid non NULL pointer to
* ithread_mutexattr_t * attr (must be valid non NULL pointer to
* pthread_mutexattr_t)
* int *kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP
* or ITHREAD_MUTEX_ERRORCHECK_NP)
@@ -215,9 +242,9 @@ extern "C" {
* See man page for pthread_mutexattr_getkind_np
*****************************************************************************/
#ifdef PTHREAD_MUTEX_RECURSIVE
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
#define ithread_mutexattr_getkind_np pthread_mutexattr_gettype
#else
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
#define ithread_mutexattr_getkind_np pthread_mutexattr_getkind_np
#endif
@@ -238,6 +265,7 @@ extern "C" {
*****************************************************************************/
#define ithread_mutex_init pthread_mutex_init
/****************************************************************************
* Function: ithread_mutex_lock
*
@@ -292,6 +320,169 @@ extern "C" {
#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
*

View File

@@ -30,7 +30,8 @@
///////////////////////////////////////////////////////////////////////////
#include "LinkedList.h"
#ifdef __FreeBSD__
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
#include <stdlib.h>
#else
#include <malloc.h>

View File

@@ -90,20 +90,23 @@ FreeThreadPoolJob( ThreadPool * tp,
static int
SetPolicyType( PolicyType in )
{
#ifdef __CYGWIN__
/* TODO not currently working... */
return 0;
#else
#ifdef WIN32
#ifdef __CYGWIN__
/* TODO not currently working... */
return 0;
#elif defined(__OSX__)
setpriority(PRIO_PROCESS, 0, 0);
return 0;
#elif defined(WIN32)
return sched_setscheduler( 0, in);
#else
#elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
struct sched_param current;
sched_getparam( 0, &current );
current.sched_priority = DEFAULT_SCHED_PARAM;
return sched_setscheduler( 0, in, &current );
#endif
#endif
#else
return 0;
#endif
}
/****************************************************************************
@@ -123,7 +126,7 @@ SetPolicyType( PolicyType in )
static int
SetPriority( ThreadPriority priority )
{
#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
int currentPolicy;
int minPriority = 0;
int maxPriority = 0;
@@ -155,7 +158,9 @@ SetPriority( ThreadPriority priority )
return pthread_setschedparam( ithread_self(), currentPolicy,
&newPriority );
#else
return 0;
#endif
}
/****************************************************************************
@@ -354,18 +359,25 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
* Parameters:
*
*****************************************************************************/
static void SetSeed() {
struct timeb t;
static void SetSeed() {
struct timeb t;
ftime( &t );
ftime( &t );
#if defined(WIN32)
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id().p );
#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().p );
#elif defined(__FreeBSD__) || defined(__OSX__)
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
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
}
}
/****************************************************************************
* Function: WorkerThread
@@ -1499,36 +1511,33 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
}
#ifdef STATS
void ThreadPoolPrintStats( ThreadPoolStats * stats ) {
assert( stats != NULL ); if( stats == NULL ) {
return;}
void ThreadPoolPrintStats(ThreadPoolStats * stats)
{
assert( stats != NULL );
if (stats == NULL) {
return;
}
#ifdef __FreeBSD__
printf( "ThreadPoolStats at Time: %d\n", time( NULL ) );
#else
printf( "ThreadPoolStats at Time: %ld\n", time( NULL ) );
#endif
printf
( "Average Wait in High Priority Q in milliseconds: %f\n",
stats->avgWaitHQ );
printf
( "Average Wait in Med Priority Q in milliseconds: %f\n",
stats->avgWaitMQ );
printf
( "Averate Wait in Low Priority Q in milliseconds: %f\n",
stats->avgWaitLQ );
printf( "Max Threads Active: %d\n", stats->maxThreads );
printf( "Current Worker Threads: %d\n",
stats->workerThreads );
printf( "Current Persistent Threads: %d\n",
stats->persistentThreads );
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
#ifdef __FreeBSD__
printf("ThreadPoolStats at Time: %d\n", time(NULL));
#else /* __FreeBSD__ */
printf("ThreadPoolStats at Time: %ld\n", time(NULL));
#endif /* __FreeBSD__ */
printf("High Jobs pending: %d\n", stats->currentJobsHQ);
printf("Med Jobs Pending: %d\n", stats->currentJobsMQ);
printf("Low Jobs Pending: %d\n", stats->currentJobsLQ);
printf("Average Wait in High Priority Q in milliseconds: %f\n", stats->avgWaitHQ);
printf("Average Wait in Med Priority Q in milliseconds: %f\n", stats->avgWaitMQ);
printf("Averate Wait in Low Priority Q in milliseconds: %f\n", stats->avgWaitLQ);
printf("Max Threads Active: %d\n", stats->maxThreads);
printf("Current Worker Threads: %d\n", stats->workerThreads);
printf("Current Persistent Threads: %d\n", stats->persistentThreads);
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 /* STATS */
/****************************************************************************
* Function: TPAttrSetMaxJobsTotal
@@ -1541,17 +1550,19 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
* Returns:
* Always returns 0.
*****************************************************************************/
int TPAttrSetMaxJobsTotal( ThreadPoolAttr * attr,
int maxJobsTotal ) {
assert( attr != NULL );
int TPAttrSetMaxJobsTotal(
ThreadPoolAttr * attr,
int maxJobsTotal )
{
assert( attr != NULL );
if( attr == NULL ) {
return EINVAL;
}
if( attr == NULL ) {
return EINVAL;
}
attr->maxJobsTotal = maxJobsTotal;
return 0;
}
attr->maxJobsTotal = maxJobsTotal;
return 0;
}
/****************************************************************************
* Function: ThreadPoolGetStats
@@ -1568,40 +1579,54 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
*****************************************************************************/
#ifdef STATS
int
ThreadPoolGetStats( ThreadPool * tp,
ThreadPoolStats * stats ) {
ThreadPoolGetStats(
ThreadPool *tp,
ThreadPoolStats *stats)
{
assert(tp != NULL);
assert(stats != NULL);
assert( tp != NULL );
assert( stats != NULL );
if( ( tp == NULL ) || ( stats == NULL ) ) {
return EINVAL;}
if (tp == NULL || stats == NULL) {
return EINVAL;
}
//if not shutdown then acquire mutex
if( !tp->shutdown ) {
ithread_mutex_lock( &tp->mutex );}
//if not shutdown then acquire mutex
if (!tp->shutdown) {
ithread_mutex_lock(&tp->mutex);
}
( *stats ) = tp->stats; if( stats->totalJobsHQ > 0 )
stats->avgWaitHQ =
stats->totalTimeHQ / stats->totalJobsHQ;
else
stats->avgWaitHQ = 0; if( stats->totalJobsMQ > 0 )
stats->avgWaitMQ =
stats->totalTimeMQ / stats->totalJobsMQ;
else
stats->avgWaitMQ = 0; if( stats->totalJobsLQ > 0 )
stats->avgWaitLQ =
stats->totalTimeLQ / stats->totalJobsLQ;
else
stats->avgWaitLQ = 0;
stats->totalThreads = tp->totalThreads;
stats->persistentThreads = tp->persistentThreads;
stats->currentJobsHQ = ListSize( &tp->highJobQ );
stats->currentJobsLQ = ListSize( &tp->lowJobQ );
stats->currentJobsMQ = ListSize( &tp->medJobQ );
//if not shutdown then release mutex
if( !tp->shutdown ) {
ithread_mutex_unlock( &tp->mutex );}
*stats = tp->stats;
if (stats->totalJobsHQ > 0) {
stats->avgWaitHQ = stats->totalTimeHQ / stats->totalJobsHQ;
} else {
stats->avgWaitHQ = 0;
}
return 0;}
if( stats->totalJobsMQ > 0 ) {
stats->avgWaitMQ = stats->totalTimeMQ / stats->totalJobsMQ;
} else {
stats->avgWaitMQ = 0;
}
if( stats->totalJobsLQ > 0 ) {
stats->avgWaitLQ = stats->totalTimeLQ / stats->totalJobsLQ;
} else {
stats->avgWaitLQ = 0;
}
stats->totalThreads = tp->totalThreads;
stats->persistentThreads = tp->persistentThreads;
stats->currentJobsHQ = ListSize( &tp->highJobQ );
stats->currentJobsLQ = ListSize( &tp->lowJobQ );
stats->currentJobsMQ = ListSize( &tp->medJobQ );
//if not shutdown then release mutex
if( !tp->shutdown ) {
ithread_mutex_unlock( &tp->mutex );
}
return 0;
}
#endif /* STATS */
#endif

View File

@@ -31,7 +31,8 @@
#include <stdarg.h>
#include <assert.h>
#ifdef __FreeBSD__
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
#include <stdlib.h>
#else
#include <malloc.h>

View File

@@ -1,8 +1,7 @@
#
# "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
@@ -23,14 +22,14 @@ LDADD = \
upnpincludedir = $(includedir)/upnp
upnpinclude_HEADERS = inc/upnp.h
upnpinclude_HEADERS = \
inc/upnp.h \
inc/upnpdebug.h
nodist_upnpinclude_HEADERS = inc/upnpconfig.h
if ENABLE_TOOLS
upnpinclude_HEADERS += inc/upnptools.h
endif
if ENABLE_DEBUG
upnpinclude_HEADERS += inc/upnpdebug.h
endif
lib_LTLIBRARIES = libupnp.la

View File

@@ -2,7 +2,7 @@
#
# "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.

View File

@@ -47,7 +47,8 @@
#include <stdio.h>
#ifdef __FreeBSD__
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306)
#include <time.h>
#endif
#include "ixml.h"
@@ -828,46 +829,42 @@ struct Upnp_Event
* Upnp_Discovery structure correctly.
*/
typedef struct sockaddr_in SOCKADDRIN;
/** Returned in a {\bf UPNP_DISCOVERY_RESULT} callback. */
struct Upnp_Discovery
{
/** The result code of the {\bf UpnpSearchAsync} call. */
int ErrCode;
/** The result code of the {\bf UpnpSearchAsync} call. */
int ErrCode;
/** The expiration time of the advertisement. */
int Expires;
/** The expiration time of the advertisement. */
int Expires;
/** The unique device identifier. */
char DeviceId[LINE_SIZE];
/** The unique device identifier. */
char DeviceId[LINE_SIZE];
/** The device type. */
char DeviceType[LINE_SIZE];
/** The device type. */
char DeviceType[LINE_SIZE];
/** The service type. */
char ServiceType[LINE_SIZE];
/** The service type. */
char ServiceType[LINE_SIZE];
/** The service version. */
char ServiceVer[LINE_SIZE];
/** The service version. */
char ServiceVer[LINE_SIZE];
/** The URL to the UPnP description document for the device. */
char Location[LINE_SIZE];
/** The URL to the UPnP description document for the device. */
char Location[LINE_SIZE];
/** The operating system the device is running. */
char Os[LINE_SIZE];
/** The operating system the device is running. */
char Os[LINE_SIZE];
/** Date when the response was generated. */
char Date[LINE_SIZE];
/** Date when the response was generated. */
char Date[LINE_SIZE];
/** Confirmation that the MAN header was understood by the device. */
char Ext[LINE_SIZE];
/** The host address of the device responding to the search. */
SOCKADDRIN * DestAddr;
/** Confirmation that the MAN header was understood by the device. */
char Ext[LINE_SIZE];
/** The host address of the device responding to the search. */
struct sockaddr_in DestAddr;
};
/** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or {\bf

View File

@@ -1,7 +1,7 @@
/* -*- C -*- */
/*******************************************************************************
*
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -1,7 +1,7 @@
/*******************************************************************************
*
* 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.
*
* Redistribution and use in source and binary forms, with or without
@@ -246,15 +246,19 @@ static UPNP_INLINE int DebugAtThisLevel(
* Returns: void
***************************************************************************/
#ifdef DEBUG
void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
const char* DbgFileName, int DbgLineNo,
const char* FmtStr,
...)
void UpnpPrintf(
Upnp_LogLevel DLevel,
Dbg_Module Module,
const char* DbgFileName,
int DbgLineNo,
const char* FmtStr,
...)
#if (__GNUC__ >= 3)
/* This enables printf like format checking by the compiler */
__attribute__((format (__printf__, 5, 6)))
#endif
;
#else
#else /* DEBUG */
static UPNP_INLINE void UpnpPrintf(
Upnp_LogLevel DLevel,
Dbg_Module Module,
@@ -262,7 +266,7 @@ static UPNP_INLINE void UpnpPrintf(
int DbgLineNo,
const char* FmtStr,
...) {}
#endif
#endif /* DEBUG */
/***************************************************************************

View File

@@ -79,8 +79,9 @@ endif
EXTRA_DIST = \
tvdevice/web/tvcontrolSCPD.xml \
tvdevice/web/tvdevicedesc.xml \
tvdevice/web/tvdevicepres.html \
tvdevice/web/tvpictureSCPD.xml
web/tvcombodesc.xml \
web/tvcontrolSCPD.xml \
web/tvdevicedesc.xml \
web/tvdevicepres.html \
web/tvpictureSCPD.xml

View File

@@ -1362,7 +1362,7 @@ TvCtrlPointStart( print_string printFunctionPtr,
ithread_mutex_init( &DeviceListMutex, 0 );
SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d",
SampleUtil_Print( "Initializing UPnP with ipaddress=%s port=%d",
ip_address, port );
rc = UpnpInit( ip_address, port );
if( UPNP_E_SUCCESS != rc ) {

View File

@@ -37,6 +37,7 @@
#include <string.h>
#include <sys/stat.h>
#ifndef WIN32
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -53,6 +54,11 @@
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306)
#include <ifaddrs.h>
#endif
#endif
#include "upnpapi.h"
#include "httpreadwrite.h"
@@ -73,11 +79,13 @@
#include "urlconfig.h"
#endif // INTERNAL_WEB_SERVER
virtualDirList *pVirtualDirList;
// Mutex to synchronize the subscription handling at the client side
CLIENTONLY( ithread_mutex_t GlobalClientSubscribeMutex; )
//Mutex to synchronize handles ( root device or control point handle)
ithread_mutex_t GlobalHndMutex;
// rwlock to synchronize handles (root device or control point handle)
ithread_rwlock_t GlobalHndRWLock;
// Mutex to synchronize the uuid creation process
ithread_mutex_t gUUIDMutex;
@@ -205,26 +213,26 @@ int UpnpInit( IN const char *HostIP,
#ifdef __CYGWIN__
/* On Cygwin, pthread_mutex_init() fails without this memset. */
/* TODO: Fix Cygwin so we don't need this memset(). */
memset(&GlobalHndMutex, 0, sizeof(GlobalHndMutex));
memset(&GlobalHndRWLock, 0, sizeof(GlobalHndRWLock));
#endif
if( ithread_mutex_init( &GlobalHndMutex, NULL ) != 0 ) {
if (ithread_rwlock_init(&GlobalHndRWLock, NULL) != 0) {
return UPNP_E_INIT_FAILED;
}
if( ithread_mutex_init( &gUUIDMutex, NULL ) != 0 ) {
if (ithread_mutex_init(&gUUIDMutex, NULL) != 0) {
return UPNP_E_INIT_FAILED;
}
// initialize subscribe mutex
#ifdef INCLUDE_CLIENT_APIS
if ( ithread_mutex_init( &GlobalClientSubscribeMutex, NULL ) != 0 ) {
if (ithread_mutex_init(&GlobalClientSubscribeMutex, NULL) != 0) {
return UPNP_E_INIT_FAILED;
}
#endif
HandleLock();
if( HostIP != NULL )
HandleLock();
if( HostIP != NULL ) {
strcpy( LOCAL_HOST, HostIP );
else {
} else {
if( getlocalhostname( LOCAL_HOST ) != UPNP_E_SUCCESS ) {
HandleUnlock();
return UPNP_E_INIT_FAILED;
@@ -315,27 +323,54 @@ int UpnpInit( IN const char *HostIP,
#ifdef DEBUG
static void
PrintThreadPoolStats (const char* DbgFileName, int DbgLineNo,
const char* msg, const ThreadPoolStats* const stats)
PrintThreadPoolStats(
ThreadPool *tp,
const char *DbgFileName,
int DbgLineNo,
const char *msg)
{
UpnpPrintf (UPNP_INFO, API, DbgFileName, DbgLineNo,
"%s \n High Jobs pending = %d \nMed Jobs Pending = %d\n"
" Low Jobs Pending = %d \nWorker Threads = %d\n"
"Idle Threads = %d\nPersistent Threads = %d\n"
"Average Time spent in High Q = %lf\n"
"Average Time spent in Med Q = %lf\n"
"Average Time spent in Low Q = %lf\n"
"Max Threads Used: %d\nTotal Work Time= %lf\n"
"Total Idle Time = %lf\n",
msg,
stats->currentJobsHQ, stats->currentJobsMQ,
stats->currentJobsLQ, stats->workerThreads,
stats->idleThreads, stats->persistentThreads,
stats->avgWaitHQ, stats->avgWaitMQ, stats->avgWaitLQ,
stats->maxThreads, stats->totalWorkTime,
stats->totalIdleTime );
ThreadPoolStats stats;
ThreadPoolGetStats(tp, &stats);
UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo,
"%s \n"
"High Jobs pending: %d\n"
"Med Jobs Pending: %d\n"
"Low Jobs Pending: %d\n"
"Average wait in High Q in milliseconds: %lf\n"
"Average wait in Med Q in milliseconds: %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,
stats.currentJobsHQ,
stats.currentJobsMQ,
stats.currentJobsLQ,
stats.avgWaitHQ,
stats.avgWaitMQ,
stats.avgWaitLQ,
stats.maxThreads,
stats.workerThreads,
stats.persistentThreads,
stats.idleThreads,
stats.totalThreads,
stats.totalWorkTime,
stats.totalIdleTime);
}
#endif
#else /* DEBUG */
static UPNP_INLINE void
PrintThreadPoolStats(
ThreadPool *tp,
const char *DbgFileName,
int DbgLineNo,
const char *msg)
{
}
#endif /* DEBUG */
/****************************************************************************
@@ -366,10 +401,6 @@ UpnpFinish()
#endif
struct Handle_Info *temp;
#ifdef DEBUG
ThreadPoolStats stats;
#endif
#ifdef WIN32
// WSACleanup( );
#endif
@@ -381,18 +412,12 @@ UpnpFinish()
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
"Inside UpnpFinish : UpnpSdkInit is :%d:\n",
UpnpSdkInit );
#ifdef DEBUG
if( UpnpSdkInit == 1 ) {
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
"UpnpFinish : UpnpSdkInit is ONE\n" );
}
ThreadPoolGetStats( &gRecvThreadPool, &stats );
PrintThreadPoolStats (__FILE__, __LINE__,
"Recv Thread Pool", &stats);
ThreadPoolGetStats( &gSendThreadPool, &stats );
PrintThreadPoolStats (__FILE__, __LINE__,
"Send Thread Pool", &stats);
#endif
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
#ifdef INCLUDE_DEVICE_APIS
if( GetDeviceHandleInfo( &device_handle, &temp ) == HND_DEVICE )
UpnpUnRegisterRootDevice( device_handle );
@@ -411,44 +436,38 @@ UpnpFinish()
web_server_destroy();
#endif
#ifdef DEBUG
ThreadPoolShutdown( &gSendThreadPool );
ThreadPoolShutdown( &gRecvThreadPool );
ThreadPoolShutdown(&gSendThreadPool);
ThreadPoolShutdown(&gRecvThreadPool);
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
"Exiting UpnpFinish : UpnpSdkInit is :%d:\n",
UpnpSdkInit );
ThreadPoolGetStats( &gRecvThreadPool, &stats );
PrintThreadPoolStats( __FILE__, __LINE__,
"Recv Thread Pool", &stats);
ThreadPoolGetStats( &gSendThreadPool, &stats );
PrintThreadPoolStats(__FILE__, __LINE__,
"Send Thread Pool", &stats);
"Exiting UpnpFinish : UpnpSdkInit is :%d:\n", UpnpSdkInit);
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
UpnpCloseLog();
#endif
#ifdef INCLUDE_CLIENT_APIS
ithread_mutex_destroy( &GlobalClientSubscribeMutex );
ithread_mutex_destroy(&GlobalClientSubscribeMutex);
#endif
ithread_mutex_destroy( &GlobalHndMutex );
ithread_mutex_destroy( &gUUIDMutex );
ithread_rwlock_destroy(&GlobalHndRWLock);
ithread_mutex_destroy(&gUUIDMutex);
// remove all virtual dirs
UpnpRemoveAllVirtualDirs();
// leuk_he allow static linking:
// allow static linking
#ifdef WIN32
#ifdef PTW32_STATIC_LIB
pthread_win32_thread_detach_np ();
#endif
#endif
UpnpSdkInit = 0;
return UPNP_E_SUCCESS;
} /********************* End of UpnpFinish *************************/
}
/*************************** End of UpnpFinish *****************************/
/****************************************************************************
/******************************************************************************
* Function: UpnpGetServerPort
*
* Parameters: NONE
@@ -945,7 +964,7 @@ GetDescDocumentAndURL( IN Upnp_DescType descriptionType,
char *temp_str = NULL;
FILE *fp = NULL;
off_t fileLen;
unsigned num_read;
size_t num_read;
time_t last_modified;
struct stat file_info;
struct sockaddr_in serverAddr;
@@ -1551,7 +1570,7 @@ UpnpSearchAsync( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpSearchAsync \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -1727,7 +1746,7 @@ UpnpSubscribeAsync( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpSubscribeAsync \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -1744,15 +1763,13 @@ UpnpSubscribeAsync( IN UpnpClient_Handle Hnd,
HandleUnlock();
return UPNP_E_INVALID_PARAM;
}
HandleUnlock();
Param =
( struct UpnpNonblockParam * )
malloc( sizeof( struct UpnpNonblockParam ) );
Param = (struct UpnpNonblockParam *)
malloc(sizeof (struct UpnpNonblockParam));
if( Param == NULL ) {
HandleUnlock();
return UPNP_E_OUTOF_MEMORY;
}
HandleUnlock();
Param->FunName = SUBSCRIBE;
Param->Handle = Hnd;
@@ -1812,7 +1829,7 @@ UpnpSubscribe( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpSubscribe \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -1872,7 +1889,7 @@ UpnpUnSubscribe( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpUnSubscribe \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -1931,7 +1948,7 @@ UpnpUnSubscribeAsync( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpUnSubscribeAsync \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2005,7 +2022,7 @@ UpnpRenewSubscription( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpRenewSubscription \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2070,7 +2087,7 @@ UpnpRenewSubscriptionAsync( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpRenewSubscriptionAsync \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2165,7 +2182,7 @@ UpnpNotify( IN UpnpDevice_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpNotify \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2236,7 +2253,7 @@ UpnpNotifyExt( IN UpnpDevice_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpNotify \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2313,7 +2330,7 @@ UpnpAcceptSubscription( IN UpnpDevice_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpAcceptSubscription \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2389,7 +2406,7 @@ UpnpAcceptSubscriptionExt( IN UpnpDevice_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpAcceptSubscription \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2485,7 +2502,7 @@ UpnpSendAction( IN UpnpClient_Handle Hnd,
}
DevUDN_const = NULL;
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2569,7 +2586,7 @@ UpnpSendActionEx( IN UpnpClient_Handle Hnd,
return retVal;
}
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2645,7 +2662,7 @@ UpnpSendActionAsync( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpSendActionAsync \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2765,7 +2782,7 @@ UpnpSendActionExAsync( IN UpnpClient_Handle Hnd,
return retVal;
}
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2879,7 +2896,7 @@ UpnpGetServiceVarStatusAsync( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpGetServiceVarStatusAsync \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -2959,7 +2976,7 @@ UpnpGetServiceVarStatus( IN UpnpClient_Handle Hnd,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Inside UpnpGetServiceVarStatus \n" );
HandleLock();
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
@@ -3287,17 +3304,15 @@ UpnpDownloadXmlDoc( const char *url,
} else {
#ifdef DEBUG
xml_buf = ixmlPrintNode( ( IXML_Node * ) * xmlDoc );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Printing the Parsed xml document \n %s\n",
xml_buf );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"****************** END OF Parsed XML Doc *****************\n" );
ixmlFreeDOMString( xml_buf );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Exiting UpnpDownloadXmlDoc\n" );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Printing the Parsed xml document \n %s\n", xml_buf );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"****************** END OF Parsed XML Doc *****************\n" );
ixmlFreeDOMString( xml_buf );
#endif
return UPNP_E_SUCCESS;
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Exiting UpnpDownloadXmlDoc\n" );
return UPNP_E_SUCCESS;
}
}
@@ -3629,7 +3644,6 @@ int PrintHandleInfo( IN UpnpClient_Handle Hnd )
struct Handle_Info * HndInfo;
if (HandleTable[Hnd] != NULL) {
HndInfo = HandleTable[Hnd];
#ifdef DEBUG
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
"Printing information for Handle_%d\n", Hnd);
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
@@ -3638,7 +3652,6 @@ int PrintHandleInfo( IN UpnpClient_Handle Hnd )
if(HndInfo->HType != HND_CLIENT)
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"DescURL_%s\n", HndInfo->DescURL );
#endif
#endif
} else {
return UPNP_E_INVALID_HANDLE;
@@ -3717,8 +3730,44 @@ void printNodes( IXML_Node * tmpRoot, int depth )
strcpy( out, inet_ntoa(LocalAddr.sin_addr));
}
return UPNP_E_SUCCESS;
#else
#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
char szBuffer[MAX_INTERFACES * sizeof( struct ifreq )];
struct ifconf ifConf;
struct ifreq ifReq;

View File

@@ -173,7 +173,7 @@ int DebugAtThisLevel(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module)
{
int ret = g_log_level >= DLevel;
int ret = DLevel <= g_log_level;
ret &=
DEBUG_ALL ||
(Module == SSDP && DEBUG_SSDP ) ||

View File

@@ -36,7 +36,7 @@
#include "uri.h"
#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
struct ErrorString {
int rc; /* error code */
@@ -44,7 +44,7 @@ struct ErrorString {
};
//Intializing the array of error structures.
// Initializing the array of error structures.
struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
{UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
{UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
@@ -155,7 +155,7 @@ UpnpResolveURL( IN const char *BaseURL,
*
* Parameters:
* IN int response: flag to tell if the ActionDoc is for response
* or request
* or request
* INOUT IXML_Document **ActionDoc: request or response document
* IN char *ActionName: Name of the action request or response
* IN char *ServType: Service type
@@ -234,7 +234,7 @@ addToAction( IN int response,
*
* Parameters:
* IN int response: flag to tell if the ActionDoc is for response
* or request
* or request
* IN char * ActionName: Name of the action request or response
* IN char * ServType: Service type
* IN int NumArg :Number of arguments in the action request or response
@@ -581,4 +581,5 @@ UpnpCreatePropertySet( IN int NumArg,
return PropSet;
}
#endif
#endif // EXCLUDE_DOM == 0

View File

@@ -93,7 +93,7 @@ GenaAutoRenewSubscription( IN void *input )
}
}
if( send_callback ) {
HandleLock();
HandleReadLock();
if( GetHandleInfo( event->handle, &handle_info ) != HND_CLIENT ) {
HandleUnlock();
free_upnp_timeout( event );
@@ -543,10 +543,10 @@ genaSubscribe( IN UpnpClient_Handle client_handle,
UpnpPrintf( UPNP_INFO, GENA, __FILE__, __LINE__,
"GENA SUBSCRIBE BEGIN" );
HandleLock();
memset( out_sid, 0, sizeof( Upnp_SID ) );
HandleReadLock();
// validate handle
if( GetHandleInfo( client_handle, &handle_info ) != HND_CLIENT ) {
HandleUnlock();
@@ -881,3 +881,4 @@ gena_process_notification_event( IN SOCKINFO * info,
#endif // INCLUDE_CLIENT_APIS
#endif // EXCLUDE_GENA

View File

@@ -365,7 +365,7 @@ genaNotifyThread( IN void *input )
struct Handle_Info *handle_info;
ThreadPoolJob job;
HandleLock();
HandleReadLock();
//validate context
if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) {

View File

@@ -396,7 +396,7 @@ scanner_get_str( IN scanner_t * scanner )
* Note :
************************************************************************/
#warning The only use of the function 'scanner_pushback()' in the code is commented out.
#warning 'scanner_pushback()' is a good candidate for removal.
#warning 'scanner_pushback()' is a candidate for removal.
static UPNP_INLINE void
scanner_pushback( INOUT scanner_t * scanner,
IN size_t pushback_bytes )
@@ -966,7 +966,7 @@ read_until_crlf( INOUT scanner_t * scanner,
* PARSE_INCOMPLETE
************************************************************************/
#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 good candidate for removal.
#warning 'skip_to_end_of_header()' is a candidate for removal.
static UPNP_INLINE int
skip_to_end_of_header( INOUT scanner_t * scanner )
{

View File

@@ -349,7 +349,7 @@ http_SendMessage( IN SOCKINFO * info,
filename = ( char * )va_arg( argp, char * );
if( Instr && Instr->IsVirtualFile )
Fp = virtualDirCallback.open( filename, UPNP_READ );
Fp = (virtualDirCallback.open)( filename, UPNP_READ );
else
Fp = fopen( filename, "rb" );
@@ -475,11 +475,13 @@ http_SendMessage( IN SOCKINFO * info,
buf_length = ( size_t ) va_arg( argp, size_t );
if( buf_length > 0 ) {
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 )
goto end;
UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__,
">>> (SENT) >>>\n%.*s\n------------\n",
( int )buf_length, buf );
}
}
}

View File

@@ -880,22 +880,24 @@ GetNextRange( char **SrcRangeStr,
off_t *FirstByte,
off_t *LastByte )
{
char *Ptr,
*Tok;
int i,
F = -1,
L = -1;
char *Ptr;
char *Tok;
int i;
int64_t F = -1;
int64_t L = -1;
int Is_Suffix_byte_Range = 1;
if( *SrcRangeStr == NULL )
if( *SrcRangeStr == NULL ) {
return -1;
}
Tok = StrTok( SrcRangeStr, "," );
if( ( Ptr = strstr( Tok, "-" ) ) == NULL )
if( ( Ptr = strstr( Tok, "-" ) ) == NULL ) {
return -1;
}
*Ptr = ' ';
sscanf( Tok, "%d%d", &F, &L );
sscanf( Tok, "%"SCNd64"%"SCNd64, &F, &L );
if( F == -1 || L == -1 ) {
*Ptr = '-';
@@ -910,16 +912,15 @@ GetNextRange( char **SrcRangeStr,
}
if( Is_Suffix_byte_Range ) {
*FirstByte = L;
*LastByte = F;
*FirstByte = (off_t)L;
*LastByte = (off_t)F;
return 1;
}
}
*FirstByte = (off_t)F;
*LastByte = (off_t)L;
*FirstByte = F;
*LastByte = L;
return 1;
}
/************************************************************************
@@ -1531,7 +1532,7 @@ http_RecvPostMessage( http_parser_t * parser,
if( Instr && Instr->IsVirtualFile ) {
Fp = virtualDirCallback.open( filename, UPNP_WRITE );
Fp = (virtualDirCallback.open)( filename, UPNP_WRITE );
if( Fp == NULL ) {
return HTTP_INTERNAL_SERVER_ERROR;
}

View File

@@ -231,6 +231,15 @@ 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 ) {
// read data
numBytes = recv( sockfd, buffer, bufsize,MSG_NOSIGNAL);
@@ -243,6 +252,9 @@ sock_read_write( IN SOCKINFO * info,
send( sockfd, buffer + bytes_sent, byte_left,
MSG_DONTROUTE|MSG_NOSIGNAL);
if( num_written == -1 ) {
#ifdef SO_NOSIGPIPE
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, olen);
#endif
return num_written;
}
@@ -253,6 +265,11 @@ sock_read_write( IN SOCKINFO * info,
numBytes = bytes_sent;
}
#ifdef SO_NOSIGPIPE
setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, &old, olen);
}
#endif
if( numBytes < 0 ) {
return UPNP_E_SOCKET_ERROR;
}

View File

@@ -555,7 +555,7 @@ parse_hostport( const char *in,
int begin_port;
int hostport_size = 0;
int host_size = 0;
#ifndef WIN32
#if !defined(WIN32) && !defined(__OSX__)
char temp_hostbyname_buff[BUFFER_SIZE];
struct hostent h_buf;
#endif
@@ -626,27 +626,61 @@ parse_hostport( const char *in,
// TODO: Use autoconf to discover this rather than the
// platform-specific stuff below
#if defined(WIN32) || defined(__CYGWIN__)
h=gethostbyname(temp_host_name);
h = gethostbyname(temp_host_name);
#elif defined(SPARC_SOLARIS)
errCode = gethostbyname_r( temp_host_name,
&h,
temp_hostbyname_buff,
BUFFER_SIZE, &errcode );
errCode = gethostbyname_r(
temp_host_name,
&h,
temp_hostbyname_buff,
BUFFER_SIZE, &errcode );
#elif defined(__FreeBSD__) && __FreeBSD_version < 601103
h = lwres_gethostbyname_r( temp_host_name,
&h_buf,
temp_hostbyname_buff,
BUFFER_SIZE, &errcode );
h = lwres_gethostbyname_r(
temp_host_name,
&h_buf,
temp_hostbyname_buff,
BUFFER_SIZE, &errcode );
if ( h == NULL ) {
errCode = 1;
errCode = 1;
}
#elif defined(__OSX__)
h = gethostbyname(temp_host_name);
if ( h == NULL ) {
errCode = 1;
}
#elif defined(__linux__)
errCode = gethostbyname_r(
temp_host_name,
&h_buf,
temp_hostbyname_buff,
BUFFER_SIZE, &h, &errcode );
#else
errCode = gethostbyname_r( temp_host_name,
&h_buf,
temp_hostbyname_buff,
BUFFER_SIZE, &h, &errcode );
#endif
{
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
if( errCode == 0 ) {
if( h ) {
if( ( h->h_addrtype == AF_INET ) && ( h->h_length == 4 ) ) {

View File

@@ -261,7 +261,7 @@
/** @name Other debugging features
The UPnP SDK contains other features to aid in debugging:
see <upnp/upnpdebug.h>
see <upnp/inc/upnpdebug.h>
*/
#define DEBUG_ALL 1

View File

@@ -98,18 +98,25 @@ struct Handle_Info
int aliasInstalled; // 0 = not installed; otherwise installed
};
extern ithread_mutex_t GlobalHndMutex;
extern ithread_rwlock_t GlobalHndRWLock;
Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo);
#define HandleLock() \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying Lock"); \
ithread_mutex_lock(&GlobalHndMutex); \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "LOCK");
#define HandleLock() HandleWriteLock()
#define HandleWriteLock() \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying a write 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() \
UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock"); \
ithread_mutex_unlock(&GlobalHndMutex); \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlock");
ithread_rwlock_unlock(&GlobalHndRWLock); \
UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock");
Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out,
struct Handle_Info **HndInfo);
@@ -176,7 +183,6 @@ void UpnpThreadDistribution(struct UpnpNonblockParam * Param);
void AutoAdvertise(void *input);
int getlocalhostname(char *out);
virtualDirList *pVirtualDirList;
extern WebServerState bWebServerState;
#endif

View File

@@ -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
HandleLock();
HandleReadLock();
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
HandleUnlock();
@@ -159,7 +159,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
}
// dest addr
param.DestAddr = dest_addr;
memcpy(&param.DestAddr, dest_addr, sizeof(struct sockaddr_in) );
// EXT
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 ) {
return; // bad reply
}
//check each current search
// check each current search
HandleLock();
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
HandleUnlock();
@@ -275,14 +275,14 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
}
node = ListHead( &ctrlpt_info->SsdpSearchList );
//temporary add null termination
// temporary add null termination
//save_char = hdr_value.buf[ hdr_value.length ];
//hdr_value.buf[ hdr_value.length ] = '\0';
while( node != NULL ) {
searchArg = node->item;
matched = 0;
//check for match of ST header and search target
// check for match of ST header and search target
switch ( searchArg->requestType ) {
case SSDP_ALL:
{
@@ -327,7 +327,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
}
if( matched ) {
//schedule call back
// schedule call back
threadData =
( ResultData * ) malloc( sizeof( ResultData ) );
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 'process_reply()' is a good candidate for removal.
#warning 'process_reply()' is a candidate for removal.
static UPNP_INLINE void
process_reply( IN char *request_buf,
IN int buf_len,
@@ -538,8 +538,7 @@ SearchByTarget( IN int Mx,
if( ReqBuf == NULL )
return UPNP_E_OUTOF_MEMORY;
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
">>> SSDP SEND >>>\n%s\n", ReqBuf );
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__, ">>> SSDP SEND >>>\n");
timeTillRead = Mx;

View File

@@ -242,7 +242,7 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
// "If a multicast resource would send a response(s) to any copy of the
// request, it SHOULD send its response(s) to each copy of the request
// it receives. It MUST NOT repeat its response(s) per copy of the
// reuqest."
// request."
//
// http://www.upnp.org/download/draft-goland-http-udp-04.txt
//
@@ -270,7 +270,7 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
*
* Parameters:
* IN int msg_type : type of the message ( Search Reply, Advertisement
* or Shutdown )
* or Shutdown )
* IN char * nt : ssdp type
* IN char * usn : unique service name ( go in the HTTP Header)
* IN char * location :Location URL.
@@ -280,7 +280,7 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
* Description:
* This function creates a HTTP request packet. Depending
* on the input parameter it either creates a service advertisement
* request or service shutdown request etc.
* request or service shutdown request etc.
*
* Returns: void
*
@@ -530,7 +530,6 @@ SendReply( IN struct sockaddr_in *DestAddr,
* IN char * Udn: Device UDN
* IN char * Location: Location of Device description document.
* IN int Duration :Life time of this device.
* Description:
* This function creates the reply packet based on the input parameter,
* and send it to the client address given in its input parameter DestAddr.
@@ -607,11 +606,9 @@ DeviceReply( IN struct sockaddr_in *DestAddr,
* IN char *ServType: Service Type.
* IN char * Location: Location of Device description document.
* IN int Duration :Life time of this device.
* Description:
* This function creates the advertisement packet based
* on the input parameter, and send it to the multicast channel.
*
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
@@ -656,11 +653,9 @@ ServiceAdvertisement( IN char *Udn,
* IN char *ServType: Service Type.
* IN char * Location: Location of Device description document.
* IN int Duration :Life time of this device.
* Description:
* This function creates the advertisement packet based
* on the input parameter, and send it to the multicast channel.
*
* Returns: int
* UPNP_E_SUCCESS if successful else appropriate error
@@ -700,7 +695,6 @@ ServiceReply( IN struct sockaddr_in *DestAddr,
* IN char *ServType: Service Type.
* IN char * Location: Location of Device description document.
* IN int Duration :Service duration in sec.
* Description:
* This function creates a HTTP service shutdown request packet
* and sent it to the multicast channel through RequestHandler.
@@ -821,3 +815,4 @@ DeviceShutdown( IN char *DevType,
#endif // EXCLUDE_SSDP
#endif // INCLUDE_DEVICE_APIS

View File

@@ -75,8 +75,10 @@ CLIENTONLY( SOCKET gSsdpReqSocket = 0;
* Function : AdvertiseAndReply
*
* Parameters:
* IN int AdFlag: -1 = Send shutdown, 0 = send reply,
* 1 = Send Advertisement
* IN int AdFlag:
* -1 = Send shutdown,
* 0 = send reply,
* 1 = Send Advertisement
* IN UpnpDevice_Handle Hnd: Device handle
* IN enum SsdpSearchType SearchType:Search type for sending replies
* IN struct sockaddr_in *DestAddr:Destination address
@@ -120,16 +122,13 @@ int AdvertiseAndReply( IN int AdFlag,
"Inside AdvertiseAndReply with AdFlag = %d\n",
AdFlag );
HandleLock();
// Use a read lock
HandleReadLock();
if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) {
HandleUnlock();
return UPNP_E_INVALID_HANDLE;
}
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;
//get server info
@@ -150,15 +149,13 @@ int AdvertiseAndReply( IN int AdFlag,
}
dbgStr = ixmlNode_getNodeName( tmpNode );
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
"Extracting device type once for %s\n",
dbgStr );
// extract device type
ixmlNodeList_free( nodeList );
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
"Extracting device type once for %s\n", dbgStr );
// extract device type
ixmlNodeList_free( nodeList );
nodeList = NULL;
nodeList =
ixmlElement_getElementsByTagName( ( IXML_Element * ) tmpNode,
"deviceType" );
nodeList = ixmlElement_getElementsByTagName(
( IXML_Element * ) tmpNode, "deviceType" );
if( nodeList == NULL ) {
continue;
}
@@ -166,7 +163,6 @@ int AdvertiseAndReply( IN int AdFlag,
dbgStr = ixmlNode_getNodeName( tmpNode );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Extracting UDN for %s\n", dbgStr );
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Extracting device type\n" );
@@ -236,13 +232,12 @@ int AdvertiseAndReply( IN int AdFlag,
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__,
"Sending UDNStr = %s \n", UDNstr );
if( AdFlag ) {
if( AdFlag ) {
// send the device advertisement
if( AdFlag == 1 ) {
DeviceAdvertisement( devType, i == 0,
UDNstr, SInfo->DescURL, Exp );
} else // AdFlag == -1
{
} else { // AdFlag == -1
DeviceShutdown( devType, i == 0, UDNstr,
SERVER, SInfo->DescURL, Exp );
}
@@ -324,8 +319,9 @@ int AdvertiseAndReply( IN int AdFlag,
}
for( j = 0;; j++ ) {
tmpNode = ixmlNodeList_item( nodeList, j );
if( tmpNode == NULL )
if( tmpNode == NULL ) {
break;
}
ixmlNodeList_free( tmpNodeList );
tmpNodeList = NULL;
@@ -334,7 +330,7 @@ int AdvertiseAndReply( IN int AdFlag,
if( tmpNodeList == NULL ) {
UpnpPrintf( UPNP_CRITICAL, API, __FILE__, __LINE__,
"ServiceType not found \n" );
continue;
continue;
}
tmpNode2 = ixmlNodeList_item( tmpNodeList, 0 );
if( tmpNode2 == NULL ) {
@@ -367,26 +363,21 @@ int AdvertiseAndReply( IN int AdFlag,
} else {
switch ( SearchType ) {
case SSDP_ALL:
{
ServiceReply( DestAddr, servType,
UDNstr, SInfo->DescURL,
defaultExp );
break;
}
ServiceReply( DestAddr, servType,
UDNstr, SInfo->DescURL,
defaultExp );
break;
case SSDP_SERVICE:
{
if( ServiceType != NULL ) {
if( !strncasecmp( ServiceType,
servType,
strlen( ServiceType ) ) )
{
ServiceReply( DestAddr, servType,
UDNstr, SInfo->DescURL,
defaultExp );
}
if( ServiceType != NULL ) {
if( !strncasecmp( ServiceType,
servType,
strlen( ServiceType ) ) ) {
ServiceReply( DestAddr, servType,
UDNstr, SInfo->DescURL,
defaultExp );
}
break;
}
break;
default:
break;
} // switch(SearchType)
@@ -401,7 +392,7 @@ int AdvertiseAndReply( IN int AdFlag,
UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__,
"Exiting AdvertiseAndReply : \n" );
HandleUnlock( );
HandleUnlock();
return UPNP_E_SUCCESS;
@@ -445,7 +436,7 @@ Make_Socket_NoBlocking( int sock )
* Parameters:
* IN char *cmd: Service Name string
* OUT SsdpEvent *Evt: The SSDP event structure partially filled
* by all the function.
* by all the function.
*
* Description:
* This function fills the fields of the event structure like DeviceType,
@@ -819,18 +810,20 @@ readFromSSDPSocket( SOCKET socket )
( struct sockaddr * )&clientAddr, &socklen );
if( byteReceived > 0 ) {
requestBuf[byteReceived] = '\0';
UpnpPrintf( UPNP_INFO, SSDP,
__FILE__, __LINE__,
"Received response !!! "
"%s From host %s \n",
requestBuf,
inet_ntoa( clientAddr.sin_addr ) );
__FILE__, __LINE__,
"Start of received response ----------------------------------------------------\n"
"%s\n"
"End of received response ------------------------------------------------------\n"
"From host %s\n",
requestBuf,
inet_ntoa( clientAddr.sin_addr ) );
UpnpPrintf( UPNP_PACKET, SSDP, __FILE__, __LINE__,
"Received multicast packet:"
"\n %s\n", requestBuf );
"Start of received multicast packet --------------------------------------------\n"
"%s\n"
"End of received multicast packet ----------------------------------------------\n",
requestBuf );
//add thread pool job to handle request
if( data != NULL ) {
data->parser.msg.msg.length += byteReceived;
@@ -869,8 +862,7 @@ get_ssdp_sockets( MiniServerSockArray * out )
{
SOCKET ssdpSock;
CLIENTONLY( SOCKET ssdpReqSock;
)
CLIENTONLY( SOCKET ssdpReqSock; )
int onOff = 1;
u_char ttl = 4;
struct ip_mreq ssdpMcastAddr;
@@ -878,32 +870,31 @@ get_ssdp_sockets( MiniServerSockArray * out )
int option = 1;
struct in_addr addr;
CLIENTONLY( if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) )
== UPNP_INVALID_SOCKET ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in socket operation !!!\n" );
return UPNP_E_OUTOF_SOCKET;}
setsockopt( ssdpReqSock,
IPPROTO_IP,
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
// just do it, regardless if fails or not.
Make_Socket_NoBlocking( ssdpReqSock ); gSsdpReqSocket = ssdpReqSock; ) //CLIENTONLY
if( ( ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 ) )
== UPNP_INVALID_SOCKET ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in socket operation !!!\n" );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) );
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) );
CLIENTONLY(
if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == UPNP_INVALID_SOCKET ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in socket operation !!!\n" );
return UPNP_E_OUTOF_SOCKET;
}
}
setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
// just do it, regardless if fails or not.
Make_Socket_NoBlocking( ssdpReqSock );
gSsdpReqSocket = ssdpReqSock; )
// END CLIENTONLY
if( ( ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == UPNP_INVALID_SOCKET ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in socket operation !!!\n" );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) );
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) );
return UPNP_E_OUTOF_SOCKET;
}
onOff = 1;
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR,
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in set reuse addr !!!\n" );
@@ -916,8 +907,7 @@ get_ssdp_sockets( MiniServerSockArray * out )
#ifdef __FreeBSD__
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT,
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
( char * )&onOff, sizeof( onOff ) ) != 0 ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in set reuse port !!!\n" );
@@ -934,9 +924,8 @@ get_ssdp_sockets( MiniServerSockArray * out )
// ssdpAddr.sin_addr.s_addr = inet_addr(LOCAL_HOST);
ssdpAddr.sin_addr.s_addr = htonl( INADDR_ANY );
ssdpAddr.sin_port = htons( SSDP_PORT );
if( bind
( ssdpSock, ( struct sockaddr * )&ssdpAddr,
sizeof( ssdpAddr ) ) != 0 ) {
if( bind( ssdpSock, ( struct sockaddr * )&ssdpAddr,
sizeof( ssdpAddr ) ) != 0 ) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in binding !!!\n" );
@@ -951,8 +940,7 @@ get_ssdp_sockets( MiniServerSockArray * out )
ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST );
ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
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,
SSDP, __FILE__, __LINE__,
"Error in joining" " multicast group !!!\n" );
@@ -966,8 +954,8 @@ get_ssdp_sockets( MiniServerSockArray * out )
/* Set multicast interface. */
memset( ( void * )&addr, 0, sizeof( struct in_addr ));
addr.s_addr = inet_addr(LOCAL_HOST);
if (setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF,
(char *)&addr, sizeof addr) != 0) {
if ( setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF,
(char *)&addr, sizeof addr) != 0) {
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"Couldn't set multicast interface.\n" );
/* This is probably not a critical error, so let's continue. */
@@ -977,7 +965,7 @@ get_ssdp_sockets( MiniServerSockArray * out )
setsockopt( ssdpSock, IPPROTO_IP,
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) );
if( setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST,
( char * )&option, sizeof( option ) ) != 0 ) {
(char *)&option, sizeof(option) ) != 0) {
UpnpPrintf( UPNP_CRITICAL,
SSDP, __FILE__, __LINE__,
"Error in setting broadcast !!!\n" );
@@ -988,10 +976,10 @@ get_ssdp_sockets( MiniServerSockArray * out )
return UPNP_E_NETWORK_ERROR;
}
CLIENTONLY( out->ssdpReqSock = ssdpReqSock;
);
CLIENTONLY( out->ssdpReqSock = ssdpReqSock; );
out->ssdpSock = ssdpSock;
return UPNP_E_SUCCESS;
}
#endif // EXCLUDE_SSDP

View File

@@ -32,6 +32,7 @@
#include "config.h"
#include <assert.h>
#ifndef WIN32
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

View File

@@ -50,22 +50,11 @@
#define S43 15
#define S44 21
static void MD5Transform PROTO_LIST( ( UINT4[4],
unsigned char[64] ) );
static void Encode PROTO_LIST( ( unsigned char *,
UINT4 *,
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 void MD5Transform PROTO_LIST((UINT4[4], unsigned char[64]));
static void Encode PROTO_LIST((unsigned char *, UINT4 *, 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] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -118,14 +107,10 @@ static unsigned char PADDING[64] = {
MD5 initialization. Begins an MD5 operation, writing a new context.
*/
void
MD5Init( context )
MD5_CTX *context; /* context */
MD5Init(MD5_CTX * context)
{
context->count[0] = context->count[1] = 0;
/*
Load magic initialization constants.
*/
/* Load magic initialization constants. */
context->state[0] = 0x67452301;
context->state[1] = 0xefcdab89;
context->state[2] = 0x98badcfe;
@@ -139,114 +124,72 @@ MD5Init( context )
*/
void
MD5Update( context,
input,
inputLen )
MD5_CTX *context; /* context */
unsigned char *input; /* input block */
unsigned int inputLen; /* length of input block */
MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen)
{
unsigned int i,
index,
partLen;
unsigned int i;
unsigned int index;
unsigned int 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 ) )
context->count[1]++;
/* Update number of bits */
if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) {
context->count[1]++;
}
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
context->count[1] += ( ( UINT4 ) inputLen >> 29 );
partLen = 64 - index;
/*
Transform as many times as possible.
*/
if( inputLen >= partLen ) {
MD5_memcpy
( ( POINTER ) & context->buffer[index], ( POINTER ) input,
partLen );
MD5Transform( context->state, context->buffer );
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 );
/* Transform as many times as possible. */
if (inputLen >= partLen) {
MD5_memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD5Transform(context->state, context->buffer);
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);
}
/*
MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroizing the context.
*/
void
MD5Final( digest,
context )
unsigned char digest[16]; /* message digest */
MD5_CTX *context; /* context */
MD5Final(unsigned char digest[16], MD5_CTX *context)
{
unsigned char bits[8];
unsigned int index,
padLen;
unsigned int index;
unsigned int 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. */
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
MD5Update(context, PADDING, padLen);
padLen = ( index < 56 ) ? ( 56 - index ) : ( 120 - index );
/* Append length (before padding) */
MD5Update(context, bits, 8);
MD5Update( context, PADDING, padLen );
/*
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 ) );
/* Store state in digest */
Encode(digest, context->state, 16);
/* Zeroize sensitive information. */
MD5_memset((POINTER)context, 0, sizeof(*context));
}
/*
MD5 basic transformation. Transforms state based on block.
*/
static void
MD5Transform( state,
block )
UINT4 state[4];
unsigned char block[64];
MD5Transform(UINT4 state[4], unsigned char block[64])
{
UINT4 a = state[0],
b = state[1],
@@ -353,23 +296,16 @@ MD5Transform( state,
a multiple of 4.
*/
static void
Encode( output,
input,
len )
unsigned char *output;
UINT4 *input;
unsigned int len;
Encode(unsigned char *output, UINT4 *input, unsigned int len)
{
unsigned int i,
j;
for( i = 0, j = 0; j < len; i++, j += 4 ) {
output[j] = ( unsigned char )( input[i] & 0xff );
output[j + 1] = ( unsigned char )( ( input[i] >> 8 ) & 0xff );
output[j + 2] = ( unsigned char )( ( input[i] >> 16 ) & 0xff );
output[j + 3] = ( unsigned char )( ( input[i] >> 24 ) & 0xff );
}
unsigned int i;
unsigned int j;
for (i = 0, j = 0; j < len; ++i, j += 4) {
output[j+0] = (unsigned char)((input[i] >> 0) & 0xff);
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
}
}
/*
@@ -378,55 +314,40 @@ Encode( output,
*/
static void
Decode( output,
input,
len )
UINT4 *output;
unsigned char *input;
unsigned int len;
Decode(UINT4 *output, unsigned char *input, unsigned int len)
{
unsigned int i,
j;
for( i = 0, j = 0; j < len; i++, j += 4 )
output[i] =
( ( UINT4 ) input[j] ) | ( ( ( UINT4 ) input[j + 1] ) << 8 ) |
( ( ( UINT4 ) input[j + 2] ) << 16 ) |
( ( ( UINT4 ) input[j + 3] ) << 24 );
unsigned int i;
unsigned int j;
for (i = 0, j = 0; j < len; ++i, j += 4) {
output[i] =
(((UINT4)input[j+0]) << 0) |
(((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) |
(((UINT4)input[j+3]) << 24);
}
}
/*
Note: Replace &quot;for loop&quot; with standard memcpy if possible.
Note: Replace for loop with standard memcpy if possible.
*/
static void
MD5_memcpy( output,
input,
len )
POINTER output;
POINTER input;
unsigned int len;
MD5_memcpy(POINTER output, POINTER input, unsigned int len)
{
unsigned int i;
for( i = 0; i < len; i++ )
output[i] = input[i];
unsigned int i;
for (i = 0; i < len; ++i) {
output[i] = input[i];
}
}
/*
Note: Replace &quot;for loop&quot; with standard memset if possible.
Note: Replace for loop with standard memset if possible.
*/
static void
MD5_memset( output,
value,
len )
POINTER output;
int value;
unsigned int len;
MD5_memset(POINTER output, int value, unsigned int len)
{
unsigned int i;
for( i = 0; i < len; i++ )
( ( char * )output )[i] = ( char )value;
unsigned int i;
for (i = 0; i < len; ++i) {
((char *)output)[i] = (char)value;
}
}

View File

@@ -33,17 +33,16 @@
This sample implementation generates a random node ID
*/
void
get_ieee_node_identifier( uuid_node_t * node )
get_ieee_node_identifier(uuid_node_t *node)
{
char seed[16];
static int inited = 0;
static uuid_node_t saved_node;
if( !inited ) {
get_random_info( seed );
if (!inited) {
get_random_info(seed);
seed[0] |= 0x80;
memcpy( &saved_node, seed, sizeof( uuid_node_t ) );
memcpy(&saved_node, seed, sizeof (uuid_node_t));
inited = 1;
};
@@ -83,52 +82,48 @@ get_system_time( uuid_time_t * uuid_time )
/*-----------------------------------------------------------------------------*/
void
get_random_info( char seed[16] )
get_random_info(char seed[16])
{
MD5_CTX c;
typedef struct {
MEMORYSTATUS m;
SYSTEM_INFO s;
FILETIME t;
LARGE_INTEGER pc;
DWORD tc;
DWORD l;
char hostname[MAX_COMPUTERNAME_LENGTH + 1];
} randomness;
randomness r;
MD5_CTX c;
typedef struct {
MEMORYSTATUS m;
SYSTEM_INFO s;
FILETIME t;
LARGE_INTEGER pc;
DWORD tc;
DWORD l;
char hostname[MAX_COMPUTERNAME_LENGTH + 1];
} randomness;
randomness r;
MD5Init( &c );
/*
memory usage stats
*/
GlobalMemoryStatus( &r.m );
/*
random system stats
*/
GetSystemInfo( &r.s );
/*
100ns resolution (nominally) time of day
*/
GetSystemTimeAsFileTime( &r.t );
/*
high resolution performance counter
*/
QueryPerformanceCounter( &r.pc );
/*
milliseconds since last boot
*/
r.tc = GetTickCount( );
r.l = MAX_COMPUTERNAME_LENGTH + 1;
/* Initialize memory area so that valgrind does not complain */
memset(&r, 0, sizeof r);
GetComputerName( r.hostname, &r.l );
MD5Update( &c, &r, sizeof( randomness ) );
MD5Final( seed, &c );
/* memory usage stats */
GlobalMemoryStatus( &r.m );
/* random system stats */
GetSystemInfo( &r.s );
/* 100ns resolution (nominally) time of day */
GetSystemTimeAsFileTime( &r.t );
/* high resolution performance counter */
QueryPerformanceCounter( &r.pc );
/* milliseconds since last boot */
r.tc = GetTickCount();
r.l = MAX_COMPUTERNAME_LENGTH + 1;
GetComputerName( r.hostname, &r.l );
/* MD5 it */
MD5Init(&c);
MD5Update(&c, &r, sizeof r);
MD5Final(seed, &c);
};
#else
#else /* _WINDOWS_ */
/*-----------------------------------------------------------------------------*/
void
get_system_time( uuid_time_t * uuid_time )
get_system_time(uuid_time_t *uuid_time)
{
struct timeval tp;
@@ -145,22 +140,28 @@ get_system_time( uuid_time_t * uuid_time )
/*-----------------------------------------------------------------------------*/
void
get_random_info( char seed[16] )
get_random_info(char seed[16])
{
MD5_CTX c;
typedef struct {
// struct sysinfo s;
struct timeval t;
char hostname[257];
} randomness;
randomness r;
MD5_CTX c;
typedef struct {
//struct sysinfo s;
struct timeval t;
char hostname[257];
} randomness;
randomness r;
MD5Init( &c );
/* Initialize memory area so that valgrind does not complain */
memset(&r, 0, sizeof r);
gettimeofday( &r.t, ( struct timezone * )0 );
gethostname( r.hostname, 256 );
MD5Update( &c, &r, sizeof( randomness ) );
MD5Final( seed, &c );
/* Get some random stuff */
gettimeofday(&r.t, (struct timezone *)0);
gethostname(r.hostname, 256 );
/* MD5 it */
MD5Init(&c);
MD5Update(&c, &r, sizeof r);
MD5Final(seed, &c);
};
#endif
#endif /* _WINDOWS_ */

View File

@@ -53,10 +53,10 @@ static unsigned16 true_random( void );
uuid_create -- generator a UUID
*/
int
uuid_create( uuid_upnp * uid )
uuid_create(uuid_upnp *uid)
{
uuid_time_t timestamp,
last_time;
uuid_time_t timestamp;
uuid_time_t last_time;
unsigned16 clockseq;
uuid_node_t node;
uuid_node_t last_node;
@@ -65,61 +65,64 @@ uuid_create( uuid_upnp * uid )
/*
acquire system wide lock so we're alone
*/
UUIDLock( );
UUIDLock();
/*
get current time
*/
get_current_time( &timestamp );
get_current_time(&timestamp);
/*
get node ID
*/
get_ieee_node_identifier( &node );
get_ieee_node_identifier(&node);
/*
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
(e.g., net card swap) change clockseq
*/
if( !f || memcmp( &node, &last_node, sizeof( uuid_node_t ) ) )
clockseq = true_random( );
else if( timestamp < last_time )
if (!f || memcmp(&node, &last_node, sizeof(uuid_node_t))) {
clockseq = true_random();
} else if (timestamp < last_time) {
clockseq++;
}
/*
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
*/
write_state( clockseq, timestamp, node );
write_state(clockseq, timestamp, node);
UUIDUnlock( );
return ( 1 );
UUIDUnlock();
return 1;
};
/*-----------------------------------------------------------------------------*/
void
uuid_unpack( uuid_upnp * u,
char *out )
uuid_unpack(uuid_upnp *u, char *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",
( unsigned int )u->time_low, u->time_mid,
u->time_hi_and_version, u->clock_seq_hi_and_reserved,
u->clock_seq_low, u->node[0], u->node[1], u->node[2],
u->node[3], u->node[4], u->node[5] );
*( out + 36 ) = '\0';
sprintf(out,
"%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,
u->time_mid,
u->time_hi_and_version,
u->clock_seq_hi_and_reserved,
u->clock_seq_low,
u->node[0],
u->node[1],
u->node[2],
u->node[3],
u->node[4],
u->node[5]);
};
/*-----------------------------------------------------------------------------*/
@@ -137,11 +140,10 @@ format_uuid_v1( uuid_upnp * uid,
Construct a version 1 uuid with the information we've gathered
* plus a few constants.
*/
uid->time_low = ( unsigned long )( timestamp & 0xFFFFFFFF );
uid->time_mid = ( unsigned short )( ( timestamp >> 32 ) & 0xFFFF );
uid->time_hi_and_version = ( unsigned short )( ( timestamp >> 48 ) &
0x0FFF );
uid->time_hi_and_version |= ( 1 << 12 );
uid->time_low = (unsigned long)(timestamp & 0xFFFFFFFF);
uid->time_mid = (unsigned short)((timestamp >> 32) & 0xFFFF);
uid->time_hi_and_version = (unsigned short)((timestamp >> 48) & 0x0FFF);
uid->time_hi_and_version |= (1 << 12);
uid->clock_seq_low = clock_seq & 0xFF;
uid->clock_seq_hi_and_reserved = ( clock_seq & 0x3F00 ) >> 8;
uid->clock_seq_hi_and_reserved |= 0x80;
@@ -227,7 +229,6 @@ get_current_time( uuid_time_t * timestamp )
static int inited = 0;
if( !inited ) {
get_system_time( &time_now );
uuids_this_tick = UUIDS_PER_TICK;
inited = 1;
};

View File

@@ -105,7 +105,7 @@ main (int argc, char* argv[])
* Test library initialisation
*/
printf ("\n");
printf ("Intializing UPnP ... \n");
printf ("Initializing UPnP ... \n");
rc = UpnpInit (NULL, 0);
if ( UPNP_E_SUCCESS == rc ) {
const char* ip_address = UpnpGetServerIpAddress();