Compare commits
	
		
			1 Commits
		
	
	
		
			release-1.
			...
			release-1.
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 84692a6e84 | 
							
								
								
									
										231
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										231
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -1,228 +1,3 @@ | ||||
| ******************************************************************************* | ||||
| Version 1.6.6 | ||||
| ******************************************************************************* | ||||
|  | ||||
| 2008-04-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Added thread id's to the UpnpPrintf debug messages. Thanks to | ||||
| 	Charles Nepveu for the idea. | ||||
|  | ||||
| 2008-04-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	*  SF Bug Tracker [ 1948586 ] | ||||
| 	Uppercase U in in "xmlns:U" in Invoke Action causes seg. f. | ||||
| 	Submitted By: Thomas Norheim - kjakan_no | ||||
| 	Device no longer segfaults with the following malformed xml action: | ||||
| 	<u:SetColor xmlns:U="urn:schemas-upnp-org:service:tvpicture:1"> | ||||
| 		<Color>2</Color> | ||||
| 	</u:SetColor> | ||||
|  | ||||
| 2008-04-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Use -O0 in debug builds so that variables do not get optimized out. | ||||
|  | ||||
| 2008-04-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Apostolos Syropoulos changes for OpenSolaris x86. | ||||
|  | ||||
| 2008-03-20 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Andre Sodermans (wienerschnitzel) patch for building libupnp under | ||||
| 	windows systems with VC9. | ||||
|  | ||||
| 2008-03-20 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Andre Sodermans (wienerschnitzel) patch for building libupnp under | ||||
| 	windows systems with VC8. | ||||
|  | ||||
| 2008-03-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Fixed a printf format problem on the upnp_tv_device.c from both | ||||
| 	upnp/sample/tvdevie and upnp/sample/tvcombo directories. The variable | ||||
| 	port was a short int instead of an unsigned short and it was beeing | ||||
| 	print as a negative value. | ||||
|  | ||||
| 2008-03-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* SF Bug Tracker [ 1902668 ] Cannot compile on MSVC | ||||
| 	Submitted By Luke Kim - nereusuj | ||||
| 	Version 1.6.5 cannot be compiled because of some changes in 1.6.3. | ||||
| 	MSVC does not support stdint.h, gettimeofday(), sys/param.h, const int | ||||
| 	variables in array size and Windows does not define _WINDOWS_ but define | ||||
| 	_WINDOWS. | ||||
| 	* MSVC does not understand "const int"'s as declarators of array | ||||
| 	dimensions, we must use #define'd constants. | ||||
| 	* Use WIN32 instead of _WINDOWS_ or _WINDOWS. | ||||
|  | ||||
| 2008-02-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* No longer ignore "upnp:rootdevice" advertisement. Thanks to Bob Ciora. | ||||
|  | ||||
| 2008-02-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Changed "sys_errlist[errno]", which is deprecated, by | ||||
| 	"strerror_r()", which is thread safe. | ||||
|  | ||||
| 2008-02-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Slightly improved error report by showing the sys_errlist string | ||||
| 	corresponding to errno. | ||||
|  | ||||
| 2008-02-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Got rid of two useless constants: UPNP_SOCKETERROR and | ||||
| 	UPNP_INVALID_SOCKET. They both mean the same, that a network API | ||||
| 	function has failed. -1 is the value to check, not an invented constant. | ||||
|  | ||||
| ******************************************************************************* | ||||
| Version 1.6.5 | ||||
| ******************************************************************************* | ||||
|  | ||||
| 2008-02-02 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Peter Hartley's fix for wrong sized variable beeing passed to | ||||
| 	http_MakeMessage() on 64 bit architectures. | ||||
|  | ||||
|  | ||||
| ******************************************************************************* | ||||
| Version 1.6.4 | ||||
| ******************************************************************************* | ||||
|  | ||||
| 2008-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Workaround for a problem with the new automake AM_CONDITIONAL macro | ||||
| 	from autotools-1.10. Thanks to Ingo Hofmann for helping with debugging | ||||
| 	this one. | ||||
|  | ||||
| 2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Added quoting to macros AC_CONFIG_AUX_DIR, AC_CONFIG_MACRO_DIR and | ||||
| 	AC_CONFIG_SRCDIR in configure.ac. Also changed the name of the | ||||
| 	auxiliary directory in AC_CONFIG_AUX_DIR to build-aux. | ||||
|  | ||||
| 2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Fix for setsockopt() in Threadpool.c to allow more than one process | ||||
| 	to join the multicast-group on OSX. Thanks to Ingo Hofmann. | ||||
|  | ||||
| 2008-01-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Using defined(__OSX__) || defined(__APPLE__) instead of just | ||||
| 	defined(__OSX__) in the code. Thanks to Ingo Hofmann and Chris | ||||
| 	Pickel. | ||||
|  | ||||
| 2008-01-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Fix for isFileInVirtualDir. Thanks to Peter Hartley for the patch. | ||||
|  | ||||
| 2008-01-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Putting back a "defined(__OSX__)" that has been removed in the | ||||
| 	previous *BSD patch. Thanks to Chris Pickel for pointing it out. | ||||
|  | ||||
| 2008-01-07 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* SF Patches Tracker [ 1865812 ] typo in docs comment | ||||
| 	Submitted By: Hartmut Holzgraefe - hholzgra | ||||
| 	typo in docs comment ACCAPTED instead of ACCEPTED in | ||||
| 	@name UPNP_E_UNSUBSCRIBE_UNACCAPTED [-302] | ||||
| 	Also, the documentation file name was mispelled and was corrected in | ||||
| 	the Makefile.am. | ||||
|  | ||||
| ******************************************************************************* | ||||
| Version 1.6.3 | ||||
| ******************************************************************************* | ||||
|  | ||||
| 2007-12-25 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Using pthread flags for the whole project, not just at the places | ||||
| 	individually indicated by several Makefile.am files spread all over | ||||
| 	the directories. That was too much error prone. | ||||
|  | ||||
| 2007-12-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Added a configure test to check if pthread_rwlock_t is available. | ||||
| 	Define _GNU_SOURCE if needed. The fallback behaviou will only be | ||||
| 	implemented if _GNU_SOURCE prooves to be insufficient on some | ||||
| 	platforms. Thanks to Jonathan Casiot (no_dice) and Robert Gingher | ||||
| 	(robsbox). | ||||
|  | ||||
| 2007-12-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Removed unused iasnprintf.{c,h} files. | ||||
|  | ||||
| 2007-12-17 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Removed STATSONLY() macro from ThreadPool.{c,h}. | ||||
| 	* Removed time() usage from ThreadPool.c. | ||||
| 	* Fixed STATS = 0 compilation. | ||||
|  | ||||
| 2007-12-16 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Library was not compiling on FreeBSD 7. Code now no longer uses | ||||
| 	ftime(), using gettimeofday() instead. Thanks to Josh Carroll. | ||||
|  | ||||
|  | ||||
| ******************************************************************************* | ||||
| Version 1.6.2 | ||||
| ******************************************************************************* | ||||
|  | ||||
| 2007-12-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Fixed a compilation error due to a missing #ifdef in | ||||
| 	upnp/src/genlib/miniserver/miniserver.c. Thanks to Eugene Christensen. | ||||
|  | ||||
| 2007-11-12 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* "make check" was failing because ixml/test/test_document.sh did not | ||||
| 	have the executable flag set. Thanks to Steve Bresson. | ||||
|  | ||||
| 2007-11-12 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Fixed a memory leak in upnpapi.c to delete gMiniServerThreadPool in | ||||
| 	the call to UpnpFinish(). Thanks to Fabrice Fontaine. | ||||
|  | ||||
| 2007-11-09 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
| 	* Added a isleep() call to the error handler of select() in | ||||
| 	RunMiniServer(), so that it does not take 100% cpu in case select() | ||||
| 	fails repeatedly. | ||||
|  | ||||
| ******************************************************************************* | ||||
| 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 | ||||
| ******************************************************************************* | ||||
| @@ -277,10 +52,6 @@ Version 1.6.0 | ||||
| 	an interface change in the library and the minor library version was | ||||
| 	bumped. Also, the libtool library numbers were changed accordingly. | ||||
|  | ||||
| ******************************************************************************* | ||||
| Version 1.4.7 | ||||
| ******************************************************************************* | ||||
|  | ||||
| 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 | ||||
| @@ -498,7 +269,7 @@ Version 1.4.2 | ||||
| 2007-01-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net> | ||||
|  | ||||
| 	* SF Tracker [ 1634922 ] Support for large files (>= 2 GiB), part 2 | ||||
| 	Submitted By: Jonathan Casiot - no_dice | ||||
| 	Submitted By: Jonathan - no_dice | ||||
| 	Summary: This patch hopefully fixes the remaining types and related | ||||
| 	code to enable files >= 2 GiB to be streamed. Jonathan claims to have | ||||
| 	tested this with a patched version of ushare-0.9.8 and a D-Link DSM-520. | ||||
|   | ||||
							
								
								
									
										25
									
								
								THANKS
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								THANKS
									
									
									
									
									
								
							| @@ -6,46 +6,31 @@ 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) | ||||
| - Andre Sodermans (wienerschnitzel) | ||||
| - Apostolos Syropoulos | ||||
| - Arno Willig | ||||
| - Bob Ciora | ||||
| - Chaos | ||||
| - Charles Nepveu (cnepveu) | ||||
| - Chris Pickel | ||||
| - Craig Nelson | ||||
| - David Maass | ||||
| - Emil Ljungdahl | ||||
| - Erik Johansson | ||||
| - Eric Tanguy | ||||
| - Erwan Velu | ||||
| - Eugene Christensen | ||||
| - Fabrice Fontaine | ||||
| - Fredrik Svensson | ||||
| - Glen Masgai | ||||
| - Hartmut Holzgraefe - hholzgra | ||||
| - Ingo Hofmann | ||||
| - Jiri Zouhar | ||||
| - John Dennis | ||||
| - Jonathan Casiot (no_dice) | ||||
| - Josh Carroll | ||||
| - Keith Brindley | ||||
| - Jonathan (no_dice) | ||||
| - Leuk_He | ||||
| - Loigu | ||||
| - Luke Kim (nereusuj) | ||||
| - Marcelo Roberto Jimenez (mroberto) | ||||
| - Luke Kim | ||||
| - Marcelo Roberto Jimenez | ||||
| - Markus Strobl | ||||
| - Nektarios K. Papadopoulos (npapadop) | ||||
| - Nektarios K. Papadopoulos | ||||
| - Oskar Liljeblad | ||||
| - Michael (oxygenic) | ||||
| - Michael (Oxy) | ||||
| - Paul Vixie | ||||
| - Peter Hartley | ||||
| - Rene Hexel | ||||
| - Robert Gingher (robsbox) | ||||
| - Siva Chandran | ||||
| - Stéphane Corthésy | ||||
| - Steve Bresson | ||||
| - Timothy Redaelli | ||||
| - Titus Winters | ||||
|  | ||||
|   | ||||
| @@ -261,7 +261,7 @@ | ||||
|  | ||||
| /** @name Other debugging features | ||||
|           The UPnP SDK contains other features to aid in debugging: | ||||
| 	  see <upnp/inc/upnpdebug.h> | ||||
| 	  see <upnp/upnpdebug.h> | ||||
|  */ | ||||
|  | ||||
| #define DEBUG_ALL		1    | ||||
|   | ||||
| @@ -1,222 +0,0 @@ | ||||
| // ISO C9x  compliant stdint.h for Microsoft Visual Studio | ||||
| // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124  | ||||
| //  | ||||
| //  Copyright (c) 2006 Alexander Chemeris | ||||
| //  | ||||
| // Redistribution and use in source and binary forms, with or without | ||||
| // modification, are permitted provided that the following conditions are met: | ||||
| //  | ||||
| //   1. Redistributions of source code must retain the above copyright notice, | ||||
| //      this list of conditions and the following disclaimer. | ||||
| //  | ||||
| //   2. Redistributions in binary form must reproduce the above copyright | ||||
| //      notice, this list of conditions and the following disclaimer in the | ||||
| //      documentation and/or other materials provided with the distribution. | ||||
| //  | ||||
| //   3. The name of the author may be used to endorse or promote products | ||||
| //      derived from this software without specific prior written permission. | ||||
| //  | ||||
| // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||||
| // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||||
| // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||||
| // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||||
| // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||||
| // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||||
| // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,  | ||||
| // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||||
| // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||||
| // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| //  | ||||
| /////////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| #ifndef _MSC_VER // [ | ||||
| #error "Use this header only with Microsoft Visual C++ compilers!" | ||||
| #endif // _MSC_VER ] | ||||
|  | ||||
| #ifndef _MSC_STDINT_H_ // [ | ||||
| #define _MSC_STDINT_H_ | ||||
|  | ||||
| #if _MSC_VER > 1000 | ||||
| #pragma once | ||||
| #endif | ||||
|  | ||||
| #include <limits.h> | ||||
|  | ||||
| // For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}' | ||||
| // or compiler give many errors like this: | ||||
| //   error C2733: second C linkage of overloaded function 'wmemchr' not allowed | ||||
| #if (_MSC_VER < 1300) && defined(__cplusplus) | ||||
|    extern "C++" { | ||||
| #endif  | ||||
| #     include <wchar.h> | ||||
| #if (_MSC_VER < 1300) && defined(__cplusplus) | ||||
|    } | ||||
| #endif | ||||
|  | ||||
| // 7.18.1 Integer types | ||||
|  | ||||
| // 7.18.1.1 Exact-width integer types | ||||
| typedef __int8            int8_t; | ||||
| typedef __int16           int16_t; | ||||
| typedef __int32           int32_t; | ||||
| typedef __int64           int64_t; | ||||
| typedef unsigned __int8   uint8_t; | ||||
| typedef unsigned __int16  uint16_t; | ||||
| typedef unsigned __int32  uint32_t; | ||||
| typedef unsigned __int64  uint64_t; | ||||
|  | ||||
| // 7.18.1.2 Minimum-width integer types | ||||
| typedef int8_t    int_least8_t; | ||||
| typedef int16_t   int_least16_t; | ||||
| typedef int32_t   int_least32_t; | ||||
| typedef int64_t   int_least64_t; | ||||
| typedef uint8_t   uint_least8_t; | ||||
| typedef uint16_t  uint_least16_t; | ||||
| typedef uint32_t  uint_least32_t; | ||||
| typedef uint64_t  uint_least64_t; | ||||
|  | ||||
| // 7.18.1.3 Fastest minimum-width integer types | ||||
| typedef int8_t    int_fast8_t; | ||||
| typedef int16_t   int_fast16_t; | ||||
| typedef int32_t   int_fast32_t; | ||||
| typedef int64_t   int_fast64_t; | ||||
| typedef uint8_t   uint_fast8_t; | ||||
| typedef uint16_t  uint_fast16_t; | ||||
| typedef uint32_t  uint_fast32_t; | ||||
| typedef uint64_t  uint_fast64_t; | ||||
|  | ||||
| // 7.18.1.4 Integer types capable of holding object pointers | ||||
| #ifdef _WIN64 // [ | ||||
|    typedef __int64           intptr_t; | ||||
|    typedef unsigned __int64  uintptr_t; | ||||
| #else // _WIN64 ][ | ||||
|    typedef int               intptr_t; | ||||
|    typedef unsigned int      uintptr_t; | ||||
| #endif // _WIN64 ] | ||||
|  | ||||
| // 7.18.1.5 Greatest-width integer types | ||||
| typedef int64_t   intmax_t; | ||||
| typedef uint64_t  uintmax_t; | ||||
|  | ||||
|  | ||||
| // 7.18.2 Limits of specified-width integer types | ||||
|  | ||||
| #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259 | ||||
|  | ||||
| // 7.18.2.1 Limits of exact-width integer types | ||||
| #define INT8_MIN     ((int8_t)_I8_MIN) | ||||
| #define INT8_MAX     _I8_MAX | ||||
| #define INT16_MIN    ((int16_t)_I16_MIN) | ||||
| #define INT16_MAX    _I16_MAX | ||||
| #define INT32_MIN    ((int32_t)_I32_MIN) | ||||
| #define INT32_MAX    _I32_MAX | ||||
| #define INT64_MIN    ((int64_t)_I64_MIN) | ||||
| #define INT64_MAX    _I64_MAX | ||||
| #define UINT8_MAX    _UI8_MAX | ||||
| #define UINT16_MAX   _UI16_MAX | ||||
| #define UINT32_MAX   _UI32_MAX | ||||
| #define UINT64_MAX   _UI64_MAX | ||||
|  | ||||
| // 7.18.2.2 Limits of minimum-width integer types | ||||
| #define INT_LEAST8_MIN    INT8_MIN | ||||
| #define INT_LEAST8_MAX    INT8_MAX | ||||
| #define INT_LEAST16_MIN   INT16_MIN | ||||
| #define INT_LEAST16_MAX   INT16_MAX | ||||
| #define INT_LEAST32_MIN   INT32_MIN | ||||
| #define INT_LEAST32_MAX   INT32_MAX | ||||
| #define INT_LEAST64_MIN   INT64_MIN | ||||
| #define INT_LEAST64_MAX   INT64_MAX | ||||
| #define UINT_LEAST8_MAX   UINT8_MAX | ||||
| #define UINT_LEAST16_MAX  UINT16_MAX | ||||
| #define UINT_LEAST32_MAX  UINT32_MAX | ||||
| #define UINT_LEAST64_MAX  UINT64_MAX | ||||
|  | ||||
| // 7.18.2.3 Limits of fastest minimum-width integer types | ||||
| #define INT_FAST8_MIN    INT8_MIN | ||||
| #define INT_FAST8_MAX    INT8_MAX | ||||
| #define INT_FAST16_MIN   INT16_MIN | ||||
| #define INT_FAST16_MAX   INT16_MAX | ||||
| #define INT_FAST32_MIN   INT32_MIN | ||||
| #define INT_FAST32_MAX   INT32_MAX | ||||
| #define INT_FAST64_MIN   INT64_MIN | ||||
| #define INT_FAST64_MAX   INT64_MAX | ||||
| #define UINT_FAST8_MAX   UINT8_MAX | ||||
| #define UINT_FAST16_MAX  UINT16_MAX | ||||
| #define UINT_FAST32_MAX  UINT32_MAX | ||||
| #define UINT_FAST64_MAX  UINT64_MAX | ||||
|  | ||||
| // 7.18.2.4 Limits of integer types capable of holding object pointers | ||||
| #ifdef _WIN64 // [ | ||||
| #  define INTPTR_MIN   INT64_MIN | ||||
| #  define INTPTR_MAX   INT64_MAX | ||||
| #  define UINTPTR_MAX  UINT64_MAX | ||||
| #else // _WIN64 ][ | ||||
| #  define INTPTR_MIN   INT32_MIN | ||||
| #  define INTPTR_MAX   INT32_MAX | ||||
| #  define UINTPTR_MAX  UINT32_MAX | ||||
| #endif // _WIN64 ] | ||||
|  | ||||
| // 7.18.2.5 Limits of greatest-width integer types | ||||
| #define INTMAX_MIN   INT64_MIN | ||||
| #define INTMAX_MAX   INT64_MAX | ||||
| #define UINTMAX_MAX  UINT64_MAX | ||||
|  | ||||
| // 7.18.3 Limits of other integer types | ||||
|  | ||||
| #ifdef _WIN64 // [ | ||||
| #  define PTRDIFF_MIN  _I64_MIN | ||||
| #  define PTRDIFF_MAX  _I64_MAX | ||||
| #else  // _WIN64 ][ | ||||
| #  define PTRDIFF_MIN  _I32_MIN | ||||
| #  define PTRDIFF_MAX  _I32_MAX | ||||
| #endif  // _WIN64 ] | ||||
|  | ||||
| #define SIG_ATOMIC_MIN  INT_MIN | ||||
| #define SIG_ATOMIC_MAX  INT_MAX | ||||
|  | ||||
| #ifndef SIZE_MAX // [ | ||||
| #  ifdef _WIN64 // [ | ||||
| #     define SIZE_MAX  _UI64_MAX | ||||
| #  else // _WIN64 ][ | ||||
| #     define SIZE_MAX  _UI32_MAX | ||||
| #  endif // _WIN64 ] | ||||
| #endif // SIZE_MAX ] | ||||
|  | ||||
| // WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> | ||||
| #ifndef WCHAR_MIN // [ | ||||
| #  define WCHAR_MIN  0 | ||||
| #endif  // WCHAR_MIN ] | ||||
| #ifndef WCHAR_MAX // [ | ||||
| #  define WCHAR_MAX  _UI16_MAX | ||||
| #endif  // WCHAR_MAX ] | ||||
|  | ||||
| #define WINT_MIN  0 | ||||
| #define WINT_MAX  _UI16_MAX | ||||
|  | ||||
| #endif // __STDC_LIMIT_MACROS ] | ||||
|  | ||||
|  | ||||
| // 7.18.4 Limits of other integer types | ||||
|  | ||||
| #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260 | ||||
|  | ||||
| // 7.18.4.1 Macros for minimum-width integer constants | ||||
|  | ||||
| #define INT8_C(val)  val##i8 | ||||
| #define INT16_C(val) val##i16 | ||||
| #define INT32_C(val) val##i32 | ||||
| #define INT64_C(val) val##i64 | ||||
|  | ||||
| #define UINT8_C(val)  val##ui8 | ||||
| #define UINT16_C(val) val##ui16 | ||||
| #define UINT32_C(val) val##ui32 | ||||
| #define UINT64_C(val) val##ui64 | ||||
|  | ||||
| // 7.18.4.2 Macros for greatest-width integer constants | ||||
| #define INTMAX_C   INT64_C | ||||
| #define UINTMAX_C  UINT64_C | ||||
|  | ||||
| #endif // __STDC_CONSTANT_MACROS ] | ||||
|  | ||||
|  | ||||
| #endif // _MSC_STDINT_H_ ] | ||||
| @@ -1,223 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="ixml" | ||||
| 	ProjectGUID="{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}" | ||||
| 	RootNamespace="ixml" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="4" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLibrarianTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				RuntimeLibrary="2" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\attr.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\document.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\element.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixml.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlmembuf.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlparser.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\namedNodeMap.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\node.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\nodeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\inc\ixml.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\inc\ixmlmembuf.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\inc\ixmlparser.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,65 +0,0 @@ | ||||
|  | ||||
| Microsoft Visual Studio Solution File, Format Version 9.00 | ||||
| # Visual Studio 2005 | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}" | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcproj", "{24884928-0501-4CF2-BC8A-180AFC23B2AF}" | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcproj", "{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}" | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvdevice", "tvdevice.vcproj", "{F592B023-E1F3-4A1E-841E-662DEE497435}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF} | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvctrlpt", "tvctrlpt.vcproj", "{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF} | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvcombo", "tvcombo.vcproj", "{B5D74697-F615-4DCB-AA8B-935F6372F01C}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF} | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|Win32 = Debug|Win32 | ||||
| 		Release|Win32 = Release|Win32 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{F592B023-E1F3-4A1E-841E-662DEE497435}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{F592B023-E1F3-4A1E-841E-662DEE497435}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{F592B023-E1F3-4A1E-841E-662DEE497435}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{F592B023-E1F3-4A1E-841E-662DEE497435}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Release|Win32.Build.0 = Release|Win32 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
| 	EndGlobalSection | ||||
| EndGlobal | ||||
| @@ -1,559 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="libupnp" | ||||
| 	ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory=".\Release" | ||||
| 			IntermediateDirectory=".\Release" | ||||
| 			ConfigurationType="2" | ||||
| 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" | ||||
| 			UseOfMFC="0" | ||||
| 			ATLMinimizesCRunTimeLibraryUsage="false" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="NDEBUG" | ||||
| 				MkTypLibCompatible="true" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				TargetEnvironment="1" | ||||
| 				TypeLibraryName=".\Release/libupnp.tlb" | ||||
| 				HeaderFileName="" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				InlineFunctionExpansion="1" | ||||
| 				AdditionalIncludeDirectories="..\..\pthreads\include,..\ixml\src\inc,..\ixml\inc,..\threadutil\inc,..\upnp\inc,..\upnp\src\inc,.\inc" | ||||
| 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP" | ||||
| 				StringPooling="true" | ||||
| 				RuntimeLibrary="0" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				PrecompiledHeaderFile=".\Release/libupnp.pch" | ||||
| 				AssemblerListingLocation=".\Release/" | ||||
| 				ObjectFile=".\Release/" | ||||
| 				ProgramDataBaseFileName=".\Release/" | ||||
| 				BrowseInformation="1" | ||||
| 				WarningLevel="3" | ||||
| 				SuppressStartupBanner="true" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="NDEBUG" | ||||
| 				Culture="1031" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib" | ||||
| 				OutputFile=".\Release/libupnp.dll" | ||||
| 				LinkIncremental="1" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				ProgramDatabaseFile=".\Release/libupnp.pdb" | ||||
| 				ImportLibrary=".\Release/libupnp.lib" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				OutputFile=".\Release/libupnp.bsc" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="2" | ||||
| 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" | ||||
| 			UseOfMFC="0" | ||||
| 			ATLMinimizesCRunTimeLibraryUsage="false" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="_DEBUG" | ||||
| 				MkTypLibCompatible="true" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				TargetEnvironment="1" | ||||
| 				TypeLibraryName=".\Debug/libupnp.tlb" | ||||
| 				HeaderFileName="" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc" | ||||
| 				PreprocessorDefinitions="DEBUG;WIN32;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="1" | ||||
| 				PrecompiledHeaderFile="$(OutDir)\libupnp.pch" | ||||
| 				AssemblerListingLocation="$(OutDir)\" | ||||
| 				ObjectFile="$(OutDir)\" | ||||
| 				ProgramDataBaseFileName="$(OutDir)\" | ||||
| 				BrowseInformation="1" | ||||
| 				WarningLevel="3" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG" | ||||
| 				Culture="1031" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib" | ||||
| 				OutputFile="$(OutDir)\libupnp.dll" | ||||
| 				LinkIncremental="2" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				ProgramDatabaseFile="$(OutDir)\libupnp.pdb" | ||||
| 				ImportLibrary="$(OutDir)\libupnp.lib" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				OutputFile="$(OutDir)\libupnp.bsc" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="sources" | ||||
| 			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\attr.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\client_table\client_table.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\document.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\element.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\FreeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\gena\gena_callback2.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\gena\gena_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\gena\gena_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\httpparser.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\httpreadwrite.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inet_pton.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixml.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlmembuf.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlparser.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\LinkedList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\uuid\md5.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\membuffer.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\miniserver\miniserver.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\namedNodeMap.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\node.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\nodeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\parsetools.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\service_table\service_table.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\soap\soap_common.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\soap\soap_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\soap\soap_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\sock.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\ssdp\ssdp_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\ssdp\ssdp_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\ssdp\ssdp_server.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\strintmap.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\uuid\sysdep.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\ThreadPool.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\TimerThread.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\upnp_timeout.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\api\upnpapi.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\api\upnpdebug.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\api\upnptools.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\uri\uri.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\urlconfig\urlconfig.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\uuid\uuid.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\webserver.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\win_dll.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="headers" | ||||
| 			Filter="h;hpp;hxx;hm;inl" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\client_table.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\config.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gena.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gena_ctrlpt.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gena_device.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\global.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gmtdate.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\http_client.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\httpparser.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\httpreadwrite.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\inet_pton.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\md5.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\membuffer.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\miniserver.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\netall.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\parsetools.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\server.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\service_table.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\soaplib.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\sock.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\ssdplib.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\statcodes.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\statuscodes.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\strintmap.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\sysdep.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\unixutil.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\upnp_timeout.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\upnpapi.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\upnpclosesocket.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\inc\upnpdebug.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\uri.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\urlconfig.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\utilall.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\uuid.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\webserver.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="resources" | ||||
| 			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 		<File | ||||
| 			RelativePath="..\..\..\..\libupnp_win32.patch" | ||||
| 			> | ||||
| 		</File> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,213 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="threadutil" | ||||
| 	ProjectGUID="{24884928-0501-4CF2-BC8A-180AFC23B2AF}" | ||||
| 	RootNamespace="threadutil" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="4" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLibrarianTool" | ||||
| 				AdditionalDependencies="pthreadVC2.lib" | ||||
| 				AdditionalLibraryDirectories="..\..\pthreads\lib" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				RuntimeLibrary="2" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\FreeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\LinkedList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\ThreadPool.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\TimerThread.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\FreeList.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\ithread.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\LinkedList.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\ThreadPool.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\TimerThread.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,216 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="tvcombo" | ||||
| 	ProjectGUID="{B5D74697-F615-4DCB-AA8B-935F6372F01C}" | ||||
| 	RootNamespace="tvcombo" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvcombo;..\..\upnp\sample\tvcombo\linux" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib" | ||||
| 				AdditionalLibraryDirectories=""$(OutDir)";"out.vc8.$(ConfigurationName)\ixml";"out.vc8.$(ConfigurationName)\threadutil";"out.vc8.$(ConfigurationName)\libupnp"" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				RuntimeLibrary="2" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\linux\upnp_tv_combo_main.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,208 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="tvctrlpt" | ||||
| 	ProjectGUID="{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}" | ||||
| 	RootNamespace="tvctrlpt" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvctrlpt;..\..\upnp\sample\tvctrlpt\linux" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib" | ||||
| 				AdditionalLibraryDirectories=""$(OutDir)";"out.vc8.$(ConfigurationName)\ixml";"out.vc8.$(ConfigurationName)\threadutil";"out.vc8.$(ConfigurationName)\libupnp"" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				RuntimeLibrary="2" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvctrlpt\linux\upnp_tv_ctrlpt_main.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,208 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="8.00" | ||||
| 	Name="tvdevice" | ||||
| 	ProjectGUID="{F592B023-E1F3-4A1E-841E-662DEE497435}" | ||||
| 	RootNamespace="tvdevice" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvdevice;..\..\upnp\sample\tvdevice\linux" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib" | ||||
| 				AdditionalLibraryDirectories=""$(OutDir)";"out.vc8.$(ConfigurationName)\ixml";"out.vc8.$(ConfigurationName)\threadutil";"out.vc8.$(ConfigurationName)\libupnp"" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				RuntimeLibrary="2" | ||||
| 				WarningLevel="3" | ||||
| 				Detect64BitPortabilityProblems="true" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebDeploymentTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvdevice\linux\upnp_tv_device_main.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,222 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="9.00" | ||||
| 	Name="ixml" | ||||
| 	ProjectGUID="{9C2C266D-35A3-465F-A297-0E21D54E5C89}" | ||||
| 	RootNamespace="ixml" | ||||
| 	TargetFrameworkVersion="196613" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="4" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc" | ||||
| 				PreprocessorDefinitions="DEBUG;WIN32" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLibrarianTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				EnableIntrinsicFunctions="true" | ||||
| 				RuntimeLibrary="2" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\attr.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\document.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\element.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixml.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlmembuf.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlparser.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\namedNodeMap.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\node.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\nodeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\inc\ixml.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\inc\ixmlmembuf.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\inc\ixmlparser.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,69 +0,0 @@ | ||||
|  | ||||
| Microsoft Visual Studio Solution File, Format Version 10.00 | ||||
| # Visual C++ Express 2008 | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}" | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcproj", "{9C2C266D-35A3-465F-A297-0E21D54E5C89}" | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcproj", "{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvctrlpt", "tvctrlpt.vcproj", "{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89} | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvdevice", "tvdevice.vcproj", "{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89} | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvcombo", "tvcombo.vcproj", "{6365804B-22C6-4D5E-91F3-0C052EB55B4F}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125} | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89} | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|Win32 = Debug|Win32 | ||||
| 		Release|Win32 = Release|Win32 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Release|Win32.Build.0 = Release|Win32 | ||||
| 		{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Debug|Win32.ActiveCfg = Debug|Win32 | ||||
| 		{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Debug|Win32.Build.0 = Debug|Win32 | ||||
| 		{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Release|Win32.ActiveCfg = Release|Win32 | ||||
| 		{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Release|Win32.Build.0 = Release|Win32 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
| 	EndGlobalSection | ||||
| EndGlobal | ||||
| @@ -1,558 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="9.00" | ||||
| 	Name="libupnp" | ||||
| 	ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}" | ||||
| 	TargetFrameworkVersion="131072" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory=".\Release" | ||||
| 			IntermediateDirectory=".\Release" | ||||
| 			ConfigurationType="2" | ||||
| 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" | ||||
| 			UseOfMFC="0" | ||||
| 			ATLMinimizesCRunTimeLibraryUsage="false" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="NDEBUG" | ||||
| 				MkTypLibCompatible="true" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				TargetEnvironment="1" | ||||
| 				TypeLibraryName=".\Release/libupnp.tlb" | ||||
| 				HeaderFileName="" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				InlineFunctionExpansion="1" | ||||
| 				AdditionalIncludeDirectories="..\..\pthreads\include,..\ixml\src\inc,..\ixml\inc,..\threadutil\inc,..\upnp\inc,..\upnp\src\inc,.\inc" | ||||
| 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP" | ||||
| 				StringPooling="true" | ||||
| 				RuntimeLibrary="0" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				PrecompiledHeaderFile=".\Release/libupnp.pch" | ||||
| 				AssemblerListingLocation=".\Release/" | ||||
| 				ObjectFile=".\Release/" | ||||
| 				ProgramDataBaseFileName=".\Release/" | ||||
| 				BrowseInformation="1" | ||||
| 				WarningLevel="3" | ||||
| 				SuppressStartupBanner="true" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="NDEBUG" | ||||
| 				Culture="1031" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib" | ||||
| 				OutputFile=".\Release/libupnp.dll" | ||||
| 				LinkIncremental="1" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				ProgramDatabaseFile=".\Release/libupnp.pdb" | ||||
| 				RandomizedBaseAddress="1" | ||||
| 				DataExecutionPrevention="0" | ||||
| 				ImportLibrary=".\Release/libupnp.lib" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				OutputFile=".\Release/libupnp.bsc" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="2" | ||||
| 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" | ||||
| 			UseOfMFC="0" | ||||
| 			ATLMinimizesCRunTimeLibraryUsage="false" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 				PreprocessorDefinitions="_DEBUG" | ||||
| 				MkTypLibCompatible="true" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				TargetEnvironment="1" | ||||
| 				TypeLibraryName=".\Debug/libupnp.tlb" | ||||
| 				HeaderFileName="" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc" | ||||
| 				PreprocessorDefinitions="DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="1" | ||||
| 				PrecompiledHeaderFile="$(OutDir)\libupnp.pch" | ||||
| 				AssemblerListingLocation="$(OutDir)\" | ||||
| 				ObjectFile="$(OutDir)\" | ||||
| 				ProgramDataBaseFileName="$(OutDir)\" | ||||
| 				BrowseInformation="1" | ||||
| 				WarningLevel="3" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 				PreprocessorDefinitions="_DEBUG" | ||||
| 				Culture="1031" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib" | ||||
| 				OutputFile="$(OutDir)\libupnp.dll" | ||||
| 				LinkIncremental="2" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				ProgramDatabaseFile="$(OutDir)\libupnp.pdb" | ||||
| 				RandomizedBaseAddress="1" | ||||
| 				DataExecutionPrevention="0" | ||||
| 				ImportLibrary="$(OutDir)\libupnp.lib" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 				SuppressStartupBanner="true" | ||||
| 				OutputFile="$(OutDir)\libupnp.bsc" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="sources" | ||||
| 			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\attr.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\client_table\client_table.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\document.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\element.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\FreeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\gena\gena_callback2.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\gena\gena_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\gena\gena_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\httpparser.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\httpreadwrite.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inet_pton.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixml.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlmembuf.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\ixmlparser.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\LinkedList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\uuid\md5.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\membuffer.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\miniserver\miniserver.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\namedNodeMap.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\node.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\ixml\src\nodeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\parsetools.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\service_table\service_table.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\soap\soap_common.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\soap\soap_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\soap\soap_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\sock.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\ssdp\ssdp_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\ssdp\ssdp_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\ssdp\ssdp_server.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\strintmap.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\uuid\sysdep.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\ThreadPool.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\TimerThread.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\upnp_timeout.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\api\upnpapi.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\api\upnpdebug.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\api\upnptools.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\uri\uri.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\urlconfig\urlconfig.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\util\util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\uuid\uuid.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\genlib\net\http\webserver.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\win_dll.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="headers" | ||||
| 			Filter="h;hpp;hxx;hm;inl" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\client_table.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\config.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gena.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gena_ctrlpt.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gena_device.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\global.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\gmtdate.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\http_client.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\httpparser.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\httpreadwrite.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\inet_pton.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\md5.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\membuffer.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\miniserver.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\netall.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\parsetools.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\server.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\service_table.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\soaplib.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\sock.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\ssdplib.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\statcodes.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\statuscodes.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\strintmap.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\sysdep.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\unixutil.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\upnp_timeout.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\upnpapi.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\upnpclosesocket.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\inc\upnpdebug.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\uri.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\urlconfig.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\utilall.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\uuid.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\src\inc\webserver.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="resources" | ||||
| 			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 		<File | ||||
| 			RelativePath="..\..\..\..\libupnp_win32.patch" | ||||
| 			> | ||||
| 		</File> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,212 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="9.00" | ||||
| 	Name="threadutil" | ||||
| 	ProjectGUID="{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}" | ||||
| 	RootNamespace="threadutil" | ||||
| 	TargetFrameworkVersion="196613" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="4" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLibrarianTool" | ||||
| 				AdditionalDependencies="pthreadVC2.lib" | ||||
| 				AdditionalLibraryDirectories="..\..\pthreads\lib" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				EnableIntrinsicFunctions="true" | ||||
| 				RuntimeLibrary="2" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\FreeList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\LinkedList.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\ThreadPool.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\src\TimerThread.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\FreeList.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\ithread.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\LinkedList.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\threadpool.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\threadutil\inc\TimerThread.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,212 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="9.00" | ||||
| 	Name="tvcombo" | ||||
| 	ProjectGUID="{6365804B-22C6-4D5E-91F3-0C052EB55B4F}" | ||||
| 	RootNamespace="tvcombo" | ||||
| 	TargetFrameworkVersion="196613" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\upnp\inc;..\..\upnp\sample\common;..\..\upnp\sample;..\..\ixml\inc;..\..\pthreads\include;..\inc;..\..\threadutil\inc;..\..\upnp\sample\tvcombo" | ||||
| 				PreprocessorDefinitions="DEBUG;WIN32" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib" | ||||
| 				AdditionalLibraryDirectories=""$(OutDir)";".\out.vc9.$(ConfigurationName)\ixml";".\out.vc9.$(ConfigurationName)\threadutil";".\out.vc9.$(ConfigurationName)\libupnp"" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				EnableIntrinsicFunctions="true" | ||||
| 				RuntimeLibrary="2" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\linux\upnp_tv_combo_main.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,204 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="9.00" | ||||
| 	Name="tvctrlpt" | ||||
| 	ProjectGUID="{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}" | ||||
| 	RootNamespace="sample" | ||||
| 	TargetFrameworkVersion="196613" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\upnp\inc;..\..\upnp\sample\common;..\..\ixml\inc;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvctrlpt\linux;..\..\upnp\sample\tvctrlpt" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib" | ||||
| 				AdditionalLibraryDirectories=""$(OutDir)";".\out.vc9.$(ConfigurationName)\ixml";".\out.vc9.$(ConfigurationName)\threadutil";".\out.vc9.$(ConfigurationName)\libupnp"" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				EnableIntrinsicFunctions="true" | ||||
| 				RuntimeLibrary="2" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvctrlpt\linux\upnp_tv_ctrlpt_main.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
| @@ -1,204 +0,0 @@ | ||||
| <?xml version="1.0" encoding="Windows-1252"?> | ||||
| <VisualStudioProject | ||||
| 	ProjectType="Visual C++" | ||||
| 	Version="9.00" | ||||
| 	Name="tvdevice" | ||||
| 	ProjectGUID="{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}" | ||||
| 	RootNamespace="tvdevice" | ||||
| 	TargetFrameworkVersion="196613" | ||||
| 	> | ||||
| 	<Platforms> | ||||
| 		<Platform | ||||
| 			Name="Win32" | ||||
| 		/> | ||||
| 	</Platforms> | ||||
| 	<ToolFiles> | ||||
| 	</ToolFiles> | ||||
| 	<Configurations> | ||||
| 		<Configuration | ||||
| 			Name="Debug|Win32" | ||||
| 			OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="0" | ||||
| 				AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvdevice;..\..\upnp\sample\tvdevice\linux" | ||||
| 				PreprocessorDefinitions="WIN32;DEBUG" | ||||
| 				MinimalRebuild="true" | ||||
| 				BasicRuntimeChecks="3" | ||||
| 				RuntimeLibrary="3" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="4" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib" | ||||
| 				AdditionalLibraryDirectories=""$(OutDir)";".\out.vc9.$(ConfigurationName)\ixml";".\out.vc9.$(ConfigurationName)\threadutil";".\out.vc9.$(ConfigurationName)\libupnp"" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 		<Configuration | ||||
| 			Name="Release|Win32" | ||||
| 			OutputDirectory="$(SolutionDir)$(ConfigurationName)" | ||||
| 			IntermediateDirectory="$(ConfigurationName)" | ||||
| 			ConfigurationType="1" | ||||
| 			CharacterSet="2" | ||||
| 			WholeProgramOptimization="1" | ||||
| 			> | ||||
| 			<Tool | ||||
| 				Name="VCPreBuildEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCustomBuildTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXMLDataGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCWebServiceProxyGeneratorTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCMIDLTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCCLCompilerTool" | ||||
| 				Optimization="2" | ||||
| 				EnableIntrinsicFunctions="true" | ||||
| 				RuntimeLibrary="2" | ||||
| 				EnableFunctionLevelLinking="true" | ||||
| 				WarningLevel="3" | ||||
| 				DebugInformationFormat="3" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManagedResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCResourceCompilerTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPreLinkEventTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCLinkerTool" | ||||
| 				GenerateDebugInformation="true" | ||||
| 				OptimizeReferences="2" | ||||
| 				EnableCOMDATFolding="2" | ||||
| 				TargetMachine="1" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCALinkTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCManifestTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCXDCMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCBscMakeTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCFxCopTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCAppVerifierTool" | ||||
| 			/> | ||||
| 			<Tool | ||||
| 				Name="VCPostBuildEventTool" | ||||
| 			/> | ||||
| 		</Configuration> | ||||
| 	</Configurations> | ||||
| 	<References> | ||||
| 	</References> | ||||
| 	<Files> | ||||
| 		<Filter | ||||
| 			Name="Source Files" | ||||
| 			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" | ||||
| 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvdevice\linux\upnp_tv_device_main.c" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Header Files" | ||||
| 			Filter="h;hpp;hxx;hm;inl;inc;xsd" | ||||
| 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" | ||||
| 			> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\common\sample_util.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 			<File | ||||
| 				RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.h" | ||||
| 				> | ||||
| 			</File> | ||||
| 		</Filter> | ||||
| 		<Filter | ||||
| 			Name="Resource Files" | ||||
| 			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" | ||||
| 			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" | ||||
| 			> | ||||
| 		</Filter> | ||||
| 	</Files> | ||||
| 	<Globals> | ||||
| 	</Globals> | ||||
| </VisualStudioProject> | ||||
							
								
								
									
										252
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										252
									
								
								configure.ac
									
									
									
									
									
								
							| @@ -4,167 +4,73 @@ | ||||
| # | ||||
| # Process this file with autoconf to produce a configure script. | ||||
| # | ||||
| # (C) Copyright 2005-2007 R<>mi Turboult <r3mi@users.sourceforge.net> | ||||
| # (C) Copyright 2005-2006 R<>mi Turboult <r3mi@users.sourceforge.net> | ||||
| # | ||||
|  | ||||
| AC_PREREQ(2.60) | ||||
|  | ||||
| AC_INIT([libupnp], [1.6.6], [mroberto@users.sourceforge.net]) | ||||
| dnl ############################################################################ | ||||
| dnl # *Independently* of the above libupnp package version, the libtool version | ||||
| dnl # of the 3 libraries need to be updated whenever there is a change released: | ||||
| dnl # "current:revision:age" (this is NOT the same as the package version), | ||||
| dnl # where: | ||||
| dnl # 	- library code modified:		revision++ | ||||
| dnl # 	- interfaces changed/added/removed:	current++ and revision=0 | ||||
| dnl # 	- interfaces added: 			age++ | ||||
| dnl # 	- interfaces removed:			age=0 | ||||
| dnl # *please update only once, before a formal release, not for each change* | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.4.1: | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:2:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [2:2:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.4.6: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in ixml | ||||
| dnl #	revision: 2 -> 3 | ||||
| dnl # - Code has changed in threadutil | ||||
| dnl #	revision: 2 -> 3 | ||||
| dnl # - Interface added in threadutil | ||||
| dnl #	current: 2 -> 3 | ||||
| dnl #	revisiion: 3 -> 0 | ||||
| dnl #	age: 0 -> 1 | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 2 -> 3 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:3:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [2:3:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.0: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in ixml | ||||
| dnl #	revision: 3 -> 4 | ||||
| dnl # - Code has changed in threadutil | ||||
| dnl #	revision: 0 -> 1 | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 3 -> 4 | ||||
| dnl # - Interface changed in upnp | ||||
| dnl #	current: 2 -> 3 | ||||
| dnl #	revision: 4 -> 0 | ||||
| dnl # - Interface removed in upnp | ||||
| dnl #	age: 0 -> 0 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:0:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.1: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in threadutil | ||||
| dnl #	revision: 1 -> 2 | ||||
| dnl # - Interface added in threadutil | ||||
| dnl #	current: 3 -> 4 | ||||
| dnl #	revision: 2 -> 0 | ||||
| dnl # - Interface added in threadutil | ||||
| dnl #	age: 1 -> 2 | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 0 -> 1 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:1:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.2: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 1 -> 2 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:0:2]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:2:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.3: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in threadutil | ||||
| dnl #	revision: 0 -> 1 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:1:2]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:2:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.4: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in threadutil | ||||
| dnl #	revision: 1 -> 2 | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 2 -> 3 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:3:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.5: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 3 -> 4 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:4:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| dnl # Release 1.6.6: | ||||
| dnl # "current:revision:age" | ||||
| dnl # | ||||
| dnl # - Code has changed in threadutil | ||||
| dnl #	revision: 2 -> 3 | ||||
| dnl # - Code has changed in upnp | ||||
| dnl #	revision: 4 -> 5 | ||||
| dnl # | ||||
| dnl #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:3:2]) | ||||
| dnl #AC_SUBST([LT_VERSION_UPNP],       [3:5:0]) | ||||
| dnl # | ||||
| dnl ############################################################################ | ||||
| AC_INIT([libupnp], [1.6.0], [mroberto@users.sourceforge.net]) | ||||
| # *Independently* of the above libupnp package version, the libtool version | ||||
| # of the 3 libraries need to be updated whenever there is a change released : | ||||
| # "current:revision:age" (this is NOT the same as the package version), where: | ||||
| # 	- library code modified:		revision++ | ||||
| # 	- interfaces changed/added/removed:	current++ and revision=0 | ||||
| # 	- interfaces added: 			age++ | ||||
| # 	- interfaces removed:			age=0 | ||||
| # *please update only once, before a formal release, not for each change* | ||||
| # | ||||
| # For release 1.4.1, we had: | ||||
| #AC_SUBST([LT_VERSION_IXML],       [2:2:0]) | ||||
| #AC_SUBST([LT_VERSION_THREADUTIL], [2:2:0]) | ||||
| #AC_SUBST([LT_VERSION_UPNP],       [2:2:0]) | ||||
| # | ||||
| # "current:revision:age" | ||||
| # | ||||
| # - Code has changed in ixml | ||||
| #	revision: 2 -> 3 | ||||
| # - Code has changed in threadutil | ||||
| #	revision: 2 -> 3 | ||||
| # - Interface added in threadutil | ||||
| #	current: 2 -> 3 | ||||
| #	revisiion: 3 -> 0 | ||||
| #	age: 0 -> 1 | ||||
| # - Code has changed in upnp | ||||
| #	revision: 2 -> 3 | ||||
| # | ||||
| # For release 1.4.6, we had: | ||||
| #AC_SUBST([LT_VERSION_IXML],       [2:3:0]) | ||||
| #AC_SUBST([LT_VERSION_THREADUTIL], [3:0:1]) | ||||
| #AC_SUBST([LT_VERSION_UPNP],       [2:3: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 | ||||
| # | ||||
| # For release 1.6.0, we had: | ||||
| #AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| #AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1]) | ||||
| #AC_SUBST([LT_VERSION_UPNP],       [3:0:0]) | ||||
| AC_SUBST([LT_VERSION_IXML],       [2:4:0]) | ||||
| AC_SUBST([LT_VERSION_THREADUTIL], [4:3:2]) | ||||
| AC_SUBST([LT_VERSION_UPNP],       [3:5:0]) | ||||
| dnl ############################################################################ | ||||
| dnl # Repeating the algorithm to place it closer to the modificatin place: | ||||
| dnl # 	- library code modified:		revision++ | ||||
| dnl # 	- interfaces changed/added/removed:	current++ and revision=0 | ||||
| dnl # 	- interfaces added: 			age++ | ||||
| dnl # 	- interfaces removed:			age=0 | ||||
| dnl # *please update only once, before a formal release, not for each change* | ||||
| dnl ############################################################################ | ||||
| AC_SUBST([LT_VERSION_THREADUTIL], [3:1:1]) | ||||
| AC_SUBST([LT_VERSION_UPNP],       [3:0:0]) | ||||
|  | ||||
|  | ||||
| AC_CONFIG_AUX_DIR([build-aux]) | ||||
| AC_CONFIG_MACRO_DIR([m4]) | ||||
| AC_CONFIG_SRCDIR([upnp/inc/upnp.h]) | ||||
|  | ||||
| AC_CONFIG_AUX_DIR(config.aux) | ||||
| AC_CONFIG_MACRO_DIR(m4) | ||||
| AC_CONFIG_SRCDIR(upnp/inc/upnp.h) | ||||
|  | ||||
| AM_INIT_AUTOMAKE([1.8 -Wall foreign subdir-objects dist-bzip2]) | ||||
|  | ||||
|  | ||||
| # | ||||
| # Get canonical host names in host and host_os | ||||
| # | ||||
| @@ -189,7 +95,8 @@ AC_REVISION([$Revision: 1.11 $]) | ||||
| upnpmaj=`echo "$PACKAGE_VERSION" | sed 's/\..*//' ` | ||||
| upnpmin=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.// ; s/[^0-9].*$//' `] | ||||
| upnppatch=[`echo "$PACKAGE_VERSION" | sed 's/^[^.]\.[^.]\.// ; s/[^0-9].*$//' `] | ||||
| AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION", [see upnpconfig.h]) | ||||
| AC_DEFINE_UNQUOTED([UPNP_VERSION_STRING], "$PACKAGE_VERSION", | ||||
| 	[see upnpconfig.h]) | ||||
| AC_DEFINE_UNQUOTED([UPNP_VERSION_MAJOR], $upnpmaj, [see upnpconfig.h]) | ||||
| AC_DEFINE_UNQUOTED([UPNP_VERSION_MINOR], $upnpmin, [see upnpconfig.h]) | ||||
| AC_DEFINE_UNQUOTED([UPNP_VERSION_PATCH], $upnppatch, [see upnpconfig.h]) | ||||
| @@ -211,6 +118,7 @@ fi | ||||
| # | ||||
| # Check for libupnp subsets | ||||
| # | ||||
|  | ||||
| RT_BOOL_ARG_ENABLE([client], [yes], [control point code (client)]) | ||||
| if test "x$enable_client" = xyes ; then | ||||
| 	AC_DEFINE(UPNP_HAVE_CLIENT, 1, [see upnpconfig.h]) | ||||
| @@ -244,13 +152,11 @@ fi | ||||
| RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code]) | ||||
|  | ||||
|  | ||||
| # | ||||
| # doc installation | ||||
| # autoconf >= 2.60 already defines ${docdir}, but we will not use its  | ||||
| # default value, which is ${datarootdir}/doc/${PACKAGE_TARNAME}. | ||||
| # That would give us ${datarootdir}/doc/libupnp, and we want the package | ||||
| # version on that. | ||||
| # | ||||
| docdir="${datadir}/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}" | ||||
| AC_MSG_CHECKING([for documentation directory]) | ||||
| AC_ARG_WITH( | ||||
| @@ -265,9 +171,7 @@ AS_HELP_STRING( | ||||
| 	[], | ||||
| 	[with_documentation=no]) | ||||
|  | ||||
| # | ||||
| # If something has been entered after an equal sign, assume it is the directory | ||||
| # | ||||
| if test x"$with_documentation" != xyes -a x"$with_documentation" != xno; then | ||||
| 	docdir="$with_documentation" | ||||
| fi | ||||
| @@ -301,9 +205,7 @@ freebsd*) | ||||
| 	echo "Using non-specific system compiler settings" | ||||
| 	if test x"$enable_debug" = xyes; then | ||||
| 		# AC_PROG_CC already sets CFLAGS to "-g -O2" by default | ||||
| 		#: | ||||
| 		# Use -O0 in debug so that variables do not get optimized out | ||||
| 		AX_CFLAGS_GCC_OPTION([-O0]) | ||||
| 		: | ||||
| 	else | ||||
| 		# add optimise for size | ||||
| 		AX_CFLAGS_GCC_OPTION([-Os]) | ||||
| @@ -355,6 +257,7 @@ AC_CHECK_HEADERS( | ||||
| # Checks for typedefs, structures, and compiler characteristics | ||||
| #	 | ||||
| AC_C_CONST | ||||
| AC_TYPE_SIZE_T | ||||
| TYPE_SOCKLEN_T | ||||
|  | ||||
|  | ||||
| @@ -369,40 +272,9 @@ AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)]) | ||||
| # | ||||
| # Checks for POSIX Threads | ||||
| # | ||||
| echo "--------------------------- pthread stuff -------------------------------------" | ||||
| ACX_PTHREAD( | ||||
| 	[], | ||||
| 	[AC_MSG_ERROR([POSIX threads are required to build this program])]) | ||||
| # | ||||
| # Update environment variables for pthreads | ||||
| # | ||||
| CC="$PTHREAD_CC" | ||||
| CFLAGS="$PTHREAD_CFLAGS $CFLAGS" | ||||
| LIBS="$PTHREAD_LIBS $LIBS" | ||||
| # | ||||
| # Determine if pthread_rwlock_t is available | ||||
| # | ||||
| echo "----------------------- pthread_rwlock_t stuff --------------------------------" | ||||
| AC_MSG_CHECKING([if pthread_rwlock_t is available]) | ||||
| AC_LANG([C]) | ||||
| AC_COMPILE_IFELSE( | ||||
| 	[AC_LANG_PROGRAM( | ||||
| 		[#include <pthread.h>], | ||||
| 		[pthread_rwlock_t *x;])], | ||||
| 	[AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t]) | ||||
| 		AC_MSG_RESULT([yes, supported without any options])], | ||||
| 	[AC_COMPILE_IFELSE( | ||||
| 		[AC_LANG_PROGRAM( | ||||
| 			[#define _GNU_SOURCE | ||||
| 			#include <pthread.h>], | ||||
| 			[pthread_rwlock_t *x;])], | ||||
| 		[AC_DEFINE([UPNP_USE_RWLOCK], [1], [Use pthread_rwlock_t]) | ||||
| 			CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" | ||||
| 			AC_MSG_RESULT([yes, definition of _GNU_SOURCE required])], | ||||
| 		[AC_DEFINE([UPNP_USE_RWLOCK], [0], [Do not use pthread_rwlock_t]) | ||||
| 			AC_MSG_RESULT([no, needs to fallback to pthread_mutex]) | ||||
| 			AC_MSG_ERROR([pthread_rwlock_t not available])])]) | ||||
| echo "-------------------------------------------------------------------------------" | ||||
|  | ||||
|  | ||||
| AC_CONFIG_FILES([ | ||||
|   | ||||
							
								
								
									
										4
									
								
								docs/dist/Makefile.am
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								docs/dist/Makefile.am
									
									
									
									
										vendored
									
									
								
							| @@ -39,7 +39,7 @@ EXTRA_DIST = \ | ||||
|     ./html/upnp/UPNP_E_SOCKET_ERROR-208.html \ | ||||
|     ./html/upnp/UPNP_E_CANCELED-210.html \ | ||||
|     ./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \ | ||||
|     ./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-302.html \ | ||||
|     ./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCAPTED-302.html \ | ||||
|     ./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \ | ||||
|     ./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \ | ||||
|     ./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \ | ||||
| @@ -295,7 +295,7 @@ if WITH_DOCUMENTATION | ||||
|         ./html/upnp/UPNP_E_SOCKET_ERROR-208.html \ | ||||
|         ./html/upnp/UPNP_E_CANCELED-210.html \ | ||||
|         ./html/upnp/UPNP_E_SUBSCRIBE_UNACCEPTED-301.html \ | ||||
|         ./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCEPTED-302.html \ | ||||
|         ./html/upnp/UPNP_E_UNSUBSCRIBE_UNACCAPTED-302.html \ | ||||
|         ./html/upnp/UPNP_E_NOTIFY_UNACCEPTED-303.html \ | ||||
|         ./html/upnp/UPNP_E_INVALID_ARGUMENT-501.html \ | ||||
|         ./html/upnp/UPNP_E_FILE_NOT_FOUND-502.html \ | ||||
|   | ||||
| @@ -268,7 +268,7 @@ ixmlDocument_createDocumentEx( OUT IXML_Document ** rtDoc ) | ||||
| * | ||||
| *=================================================================*/ | ||||
| IXML_Document * | ||||
| ixmlDocument_createDocument() | ||||
| ixmlDocument_createDocument(  ) | ||||
| { | ||||
|     IXML_Document *doc = NULL; | ||||
|  | ||||
|   | ||||
| @@ -38,6 +38,10 @@ | ||||
| #define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) ) | ||||
| #define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) ) | ||||
|  | ||||
| #ifndef WIN32 | ||||
|  #define	UPNP_INLINE inline | ||||
| #endif | ||||
|  | ||||
| #define MEMBUF_DEF_SIZE_INC		20 | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -483,7 +483,7 @@ Parser_UTF8ToInt( IN const char *ss, | ||||
| *			 | ||||
| *===============================================================================*/ | ||||
| static Parser * | ||||
| Parser_init() | ||||
| Parser_init(  ) | ||||
| { | ||||
|     Parser *newParser = NULL; | ||||
|  | ||||
| @@ -501,22 +501,17 @@ Parser_init() | ||||
| } | ||||
|  | ||||
| /*================================================================ | ||||
|  * Parser_isValidEndElement | ||||
|  *	check if a new node->nodeName matches top of element stack. | ||||
|  *	Internal to parser only. | ||||
|  *=================================================================*/ | ||||
| *   Parser_isValidEndElement | ||||
| *       check if a new node->nodeName matches top of element stack. | ||||
| *       Internal to parser only. | ||||
| * | ||||
| *=================================================================*/ | ||||
| static int | ||||
| Parser_isValidEndElement( | ||||
| 	IN Parser * xmlParser, | ||||
| Parser_isValidEndElement( IN Parser * xmlParser, | ||||
|                           IN IXML_Node * newNode ) | ||||
| { | ||||
|     assert( xmlParser ); | ||||
|     assert( xmlParser->pCurElement ); | ||||
|     assert( xmlParser->pCurElement->element ); | ||||
|     assert( newNode ); | ||||
|     assert( newNode->nodeName ); | ||||
|  | ||||
|     return strcmp( xmlParser->pCurElement->element, newNode->nodeName ) == 0; | ||||
|     return ( strcmp( xmlParser->pCurElement->element, newNode->nodeName ) | ||||
|              == 0 ); | ||||
| } | ||||
|  | ||||
| /*=============================================================== | ||||
| @@ -677,7 +672,7 @@ Parser_LoadDocument( OUT IXML_Document ** retDoc, | ||||
|     int rc = IXML_SUCCESS; | ||||
|     Parser *xmlParser = NULL; | ||||
|  | ||||
|     xmlParser = Parser_init(); | ||||
|     xmlParser = Parser_init(  ); | ||||
|     if( xmlParser == NULL ) { | ||||
|         return IXML_INSUFFICIENT_MEMORY; | ||||
|     } | ||||
| @@ -926,8 +921,6 @@ Parser_parseDocument( OUT IXML_Document ** retDoc, | ||||
|     int rc = IXML_SUCCESS; | ||||
|     IXML_CDATASection *cdataSecNode = NULL; | ||||
|  | ||||
|     // It is important that the node gets initialized here, otherwise things | ||||
|     // can go wrong on the error handler. | ||||
|     ixmlNode_init( &newNode ); | ||||
|  | ||||
|     rc = ixmlDocument_createDocumentEx( &gRootDoc ); | ||||
| @@ -943,9 +936,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc, | ||||
|     } | ||||
|  | ||||
|     while( bETag == FALSE ) { | ||||
|         // clear the newNode contents. Redundant on the first iteration, | ||||
| 	// but nonetheless, necessary due to the possible calls to | ||||
| 	// ErrorHandler above. Currently, this is just a memset to zero. | ||||
|         // clear the newNode contents | ||||
|         ixmlNode_init( &newNode ); | ||||
|  | ||||
|         if( Parser_getNextNode( xmlParser, &newNode, &bETag ) == | ||||
| @@ -1039,7 +1030,7 @@ Parser_parseDocument( OUT IXML_Document ** retDoc, | ||||
|     Parser_free( xmlParser ); | ||||
|     return rc; | ||||
|  | ||||
| ErrorHandler: | ||||
|   ErrorHandler: | ||||
|     Parser_freeNodeContent( &newNode ); | ||||
|     ixmlDocument_free( gRootDoc ); | ||||
|     Parser_free( xmlParser ); | ||||
| @@ -2506,4 +2497,3 @@ Parser_getNextNode( IN Parser * xmlParser, | ||||
|     return IXML_SYNTAX_ERR; | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -261,7 +261,7 @@ ixmlNode_setLocalName( IN IXML_Node * nodeptr, | ||||
| } | ||||
|  | ||||
| /*================================================================ | ||||
| *   ixmlNode_getNamespaceURI | ||||
| *   ixmlNode_getNodeNamespaceURI | ||||
| *       Returns the node namespaceURI | ||||
| *       External function. | ||||
| *   Returns:		 | ||||
|   | ||||
							
								
								
									
										0
									
								
								ixml/test/test_document.sh
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								ixml/test/test_document.sh
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| @@ -1,4 +1,4 @@ | ||||
| Version: 1.6.6 | ||||
| Version: 1.4.2 | ||||
| Summary: Universal Plug and Play (UPnP) SDK | ||||
| Name: libupnp | ||||
| Release: 1%{?dist} | ||||
| @@ -77,12 +77,6 @@ make install DESTDIR=$RPM_BUILD_ROOT | ||||
| rm -rf %{buildroot} | ||||
|  | ||||
| %changelog | ||||
| * Mon Nov 19 2007 Marcelo Jimenez <mroberto@users.sourceforge.net> - 1.6.2-1 | ||||
| - Update to version 1.6.2 | ||||
|  | ||||
| * 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 | ||||
|  | ||||
|   | ||||
| @@ -41,7 +41,7 @@ AC_DEFUN([RT_BOOL_ARG_ENABLE],[ | ||||
| 		               )]) | ||||
| 	test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl | ||||
| 		&& enable_[]Name=[$2] | ||||
| 	AC_MSG_RESULT($enable_[]Name) | ||||
| 	AC_MSG_RESULT($enable_[]Name)dnl | ||||
| 	AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes) | ||||
| 	dnl | ||||
| 	m4_popdef([NAME])dnl | ||||
|   | ||||
| @@ -6,6 +6,7 @@ | ||||
| # | ||||
|  | ||||
| AM_CPPFLAGS		= -I$(srcdir)/inc -I$(srcdir)/src/inc | ||||
| AM_CFLAGS		= $(PTHREAD_CFLAGS) | ||||
|  | ||||
| if ENABLE_DEBUG | ||||
|     AM_CPPFLAGS		+= -DDEBUG -DSTATS | ||||
| @@ -20,11 +21,12 @@ libthreadutil_la_LDFLAGS = -version-info $(LT_VERSION_THREADUTIL) | ||||
|  | ||||
| libthreadutil_la_SOURCES = \ | ||||
| 			src/FreeList.c src/LinkedList.c \ | ||||
| 			src/ThreadPool.c src/TimerThread.c | ||||
| 			src/ThreadPool.c src/TimerThread.c \ | ||||
| 			src/iasnprintf.c | ||||
|  | ||||
| upnpincludedir		= $(includedir)/upnp | ||||
| upnpinclude_HEADERS	= \ | ||||
| 			inc/FreeList.h inc/LinkedList.h \ | ||||
| 			inc/ThreadPool.h inc/TimerThread.h \ | ||||
| 			inc/ithread.h | ||||
| 			inc/iasnprintf.h inc/ithread.h | ||||
|  | ||||
|   | ||||
| @@ -32,12 +32,6 @@ | ||||
| #ifndef THREADPOOL_H | ||||
| #define THREADPOOL_H | ||||
|  | ||||
| #ifdef UPNP_USE_MSVCPP | ||||
| 	#define UPNP_INLINE | ||||
| #else | ||||
| 	#define UPNP_INLINE inline | ||||
| #endif | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
| @@ -70,36 +64,32 @@ typedef enum priority {LOW_PRIORITY, | ||||
| #define DEFAULT_FREE_ROUTINE NULL     /* default free routine used TPJobInit */ | ||||
| #define DEFAULT_MAX_JOBS_TOTAL 100    /* default max jobs used TPAttrInit */ | ||||
|  | ||||
| #define STATS 1 /* always include stats because code change is minimal */ | ||||
|  | ||||
|  | ||||
| /* Statistics */ | ||||
| /* always include stats because code change is minimal */ | ||||
| #define STATS 1 | ||||
| #ifdef WIN32 /* TODO: check why STATSONLY fails during compilation */ | ||||
| 	#undef STATS | ||||
| #endif | ||||
|  | ||||
| #ifdef STATS | ||||
| 	#define STATSONLY(x) x | ||||
| #else | ||||
| 	#define STATSONLY(x) | ||||
| #endif | ||||
|  | ||||
| #ifdef _DEBUG | ||||
| 	#define DEBUG 1 | ||||
| #endif | ||||
|  | ||||
| #include "LinkedList.h" | ||||
|  | ||||
| #ifdef WIN32 | ||||
|     #include <time.h> | ||||
|     #include <winsock2.h> | ||||
|     struct timezone  | ||||
|     { | ||||
|         int  tz_minuteswest; /* minutes W of Greenwich */ | ||||
|         int  tz_dsttime;     /* type of dst correction */ | ||||
|     }; | ||||
|     int gettimeofday(struct timeval *tv, struct timezone *tz); | ||||
| #else /* WIN32 */ | ||||
|     #include <sys/time.h> /* for gettimeofday() */ | ||||
| #endif | ||||
|  | ||||
| #include <sys/timeb.h> | ||||
| #include "FreeList.h" | ||||
|  | ||||
| #include "ithread.h" | ||||
| #include <errno.h> | ||||
|  | ||||
| #include <sys/timeb.h> | ||||
| #define EXPORT | ||||
|  | ||||
| typedef int PolicyType; | ||||
| #define DEFAULT_POLICY SCHED_OTHER | ||||
| #define DEFAULT_SCHED_PARAM 0 /* default priority */ | ||||
| @@ -121,28 +111,26 @@ typedef void (*free_routine)(void *arg); | ||||
|  *****************************************************************************/ | ||||
| typedef struct THREADPOOLATTR | ||||
| { | ||||
| 	/* minThreads, ThreadPool will always maintain at least this many threads */ | ||||
| 	int minThreads; | ||||
|   int minThreads;     /* minThreads, ThreadPool will always maintain at least | ||||
|                          this many threads */ | ||||
|  | ||||
| 	/* maxThreads, ThreadPool will never have more than this number of threads */ | ||||
| 	int maxThreads; | ||||
|   int maxThreads;     /* maxThreads, ThreadPool will never have more than this | ||||
|                          number of threads */ | ||||
|  | ||||
| 	/* maxIdleTime (in milliseconds) this is the maximum time a thread will | ||||
| 	 * remain idle before dying */ | ||||
| 	int maxIdleTime; | ||||
|   int maxIdleTime;    /* maxIdleTime (in milliseconds) | ||||
|                          this is the maximum time a thread will remain idle | ||||
|                          before dying */ | ||||
|  | ||||
| 	/* jobs per thread to maintain */ | ||||
| 	int jobsPerThread; | ||||
|   int jobsPerThread;  /* jobs per thread to maintain */ | ||||
|  | ||||
| 	/* maximum number of jobs that can be queued totally. */ | ||||
| 	int maxJobsTotal; | ||||
|   int maxJobsTotal;   /* maximum number of jobs that can be queued totally. */ | ||||
|  | ||||
| 	/* the time a low priority or med priority job waits before getting bumped | ||||
| 	 * up a priority (in milliseconds) */ | ||||
| 	int starvationTime; | ||||
|   int starvationTime; /* the time a low priority or med priority | ||||
| 	                 job waits before getting bumped | ||||
|                          up a priority (in milliseconds) */ | ||||
|  | ||||
|   PolicyType schedPolicy; /* scheduling policy to use */ | ||||
|  | ||||
| 	/* scheduling policy to use */ | ||||
| 	PolicyType schedPolicy; | ||||
| } ThreadPoolAttr; | ||||
|  | ||||
| /**************************************************************************** | ||||
| @@ -156,7 +144,7 @@ typedef struct THREADPOOLJOB | ||||
|   start_routine func; | ||||
|   void *arg; | ||||
|   free_routine free_func; | ||||
| 	struct timeval requestTime; | ||||
|   struct timeb requestTime; | ||||
|   int priority; | ||||
|   int jobId; | ||||
| } ThreadPoolJob; | ||||
| @@ -168,6 +156,8 @@ typedef struct THREADPOOLJOB | ||||
|  *     Structure to hold statistics | ||||
|  *****************************************************************************/ | ||||
|  | ||||
| #ifdef STATS | ||||
|  | ||||
| typedef struct TPOOLSTATS | ||||
| { | ||||
|   double totalTimeHQ; | ||||
| @@ -189,7 +179,9 @@ typedef struct TPOOLSTATS | ||||
|   int currentJobsHQ; | ||||
|   int currentJobsLQ; | ||||
|   int currentJobsMQ; | ||||
| } ThreadPoolStats; | ||||
| }ThreadPoolStats; | ||||
|  | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
| @@ -230,8 +222,11 @@ typedef struct THREADPOOL | ||||
|   | ||||
|   ThreadPoolAttr attr; /* thread pool attributes */ | ||||
|    | ||||
| #ifdef STATS | ||||
|   /* statistics */ | ||||
|   ThreadPoolStats stats; | ||||
| #endif | ||||
|   | ||||
| } ThreadPool; | ||||
|  | ||||
|  | ||||
| @@ -272,7 +267,8 @@ typedef struct THREADPOOL | ||||
|  *      INVALID_POLICY if schedPolicy can't be set | ||||
|  *      EMAXTHREADS if minimum threads is greater than maximum threads | ||||
|  *****************************************************************************/ | ||||
| int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr); | ||||
| int ThreadPoolInit(ThreadPool *tp, | ||||
|   ThreadPoolAttr *attr); | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: ThreadPoolAddPersistent | ||||
| @@ -294,7 +290,9 @@ int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr); | ||||
|  *      EOUTOFMEM not enough memory to add job. | ||||
|  *      EMAXTHREADS not enough threads to add persistent job. | ||||
|  *****************************************************************************/ | ||||
| int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId); | ||||
| int ThreadPoolAddPersistent (ThreadPool*tp, | ||||
|   ThreadPoolJob *job, | ||||
|   int *jobId); | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: ThreadPoolGetAttr | ||||
| @@ -309,7 +307,8 @@ int ThreadPoolAddPersistent(ThreadPool*tp, ThreadPoolJob *job, int *jobId); | ||||
|  *      0 on success, nonzero on failure | ||||
|  *      Always returns 0. | ||||
|  *****************************************************************************/ | ||||
| int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out); | ||||
| int ThreadPoolGetAttr(ThreadPool *tp, | ||||
|   ThreadPoolAttr *out); | ||||
| /**************************************************************************** | ||||
|  * Function: ThreadPoolSetAttr | ||||
|  * | ||||
| @@ -323,7 +322,8 @@ int ThreadPoolGetAttr(ThreadPool *tp, ThreadPoolAttr *out); | ||||
|  *      0 on success, nonzero on failure | ||||
|  *      Returns INVALID_POLICY if policy can not be set. | ||||
|  *****************************************************************************/ | ||||
| int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr); | ||||
| int ThreadPoolSetAttr(ThreadPool *tp, | ||||
|   ThreadPoolAttr *attr); | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: ThreadPoolAdd | ||||
| @@ -342,7 +342,9 @@ int ThreadPoolSetAttr(ThreadPool *tp, ThreadPoolAttr *attr); | ||||
|  *      0 on success, nonzero on failure | ||||
|  *      EOUTOFMEM if not enough memory to add job. | ||||
|  *****************************************************************************/ | ||||
| int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId); | ||||
| int ThreadPoolAdd (ThreadPool*tp, | ||||
|   ThreadPoolJob *job, | ||||
|   int *jobId); | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: ThreadPoolRemove | ||||
| @@ -359,7 +361,8 @@ int ThreadPoolAdd (ThreadPool*tp, ThreadPoolJob *job, int *jobId); | ||||
|  *      0 on success, nonzero on failure. | ||||
|  *      INVALID_JOB_ID if job not found.  | ||||
|  *****************************************************************************/ | ||||
| int ThreadPoolRemove(ThreadPool *tp, int jobId, ThreadPoolJob *out); | ||||
| int ThreadPoolRemove(ThreadPool *tp, | ||||
|   int jobId, ThreadPoolJob *out); | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -422,6 +425,7 @@ int TPJobSetPriority(ThreadPoolJob *job, ThreadPriority priority); | ||||
|  *****************************************************************************/ | ||||
| int TPJobSetFreeFunction(ThreadPoolJob *job, free_routine func); | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: TPAttrInit | ||||
|  * | ||||
| @@ -543,10 +547,6 @@ 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 | ||||
|   | ||||
							
								
								
									
										66
									
								
								threadutil/inc/iasnprintf.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								threadutil/inc/iasnprintf.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,66 @@ | ||||
| /******************************************************************************* | ||||
|  * | ||||
|  * Copyright (c) 2000-2003 Intel Corporation  | ||||
|  * All rights reserved.  | ||||
|  * | ||||
|  * Redistribution and use in source and binary forms, with or without  | ||||
|  * modification, are permitted provided that the following conditions are met:  | ||||
|  * | ||||
|  * * Redistributions of source code must retain the above copyright notice,  | ||||
|  * this list of conditions and the following disclaimer.  | ||||
|  * * Redistributions in binary form must reproduce the above copyright notice,  | ||||
|  * this list of conditions and the following disclaimer in the documentation  | ||||
|  * and/or other materials provided with the distribution.  | ||||
|  * * Neither name of Intel Corporation nor the names of its contributors  | ||||
|  * may be used to endorse or promote products derived from this software  | ||||
|  * without specific prior written permission. | ||||
|  *  | ||||
|  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  | ||||
|  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT  | ||||
|  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  | ||||
|  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR  | ||||
|  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  | ||||
|  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,  | ||||
|  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR  | ||||
|  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY  | ||||
|  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||||
|  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS  | ||||
|  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
|  * | ||||
|  ******************************************************************************/ | ||||
|  | ||||
| #include <stdarg.h> | ||||
|  | ||||
| #define EXPORT | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
|  | ||||
| /** | ||||
|  * Allocates enough memory for the | ||||
|  * Formatted string, up to max | ||||
|  * specified. | ||||
|  * With max set to -1, allocates | ||||
|  * as much size as needed. | ||||
|  * Memory must be freed using free. | ||||
|  */ | ||||
|  | ||||
| EXPORT int iasnprintf(char **ret, | ||||
| 	       int incr, | ||||
| 	       int max, | ||||
| 	       const char * fmt, ...) | ||||
| #ifndef SPARC_SOLARIS | ||||
|  #if (__GNUC__ >= 3) | ||||
| 	__attribute__((format (__printf__, 4, 5))); | ||||
|  #else | ||||
|  ; | ||||
|  #endif | ||||
|  EXPORT void iasnprintfFree(char *); | ||||
| #else | ||||
| ; | ||||
| #endif | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| } | ||||
| #endif | ||||
| @@ -42,31 +42,26 @@ 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. | ||||
| /* 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_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 | ||||
|  | ||||
| #define ITHREAD_CANCELED PTHREAD_CANCELED | ||||
|  | ||||
|    | ||||
| /*************************************************************************** | ||||
|   /*************************************************************************** | ||||
|    * Name: ithread_t | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -74,9 +69,9 @@ extern "C" { | ||||
|    *      typedef to pthread_t. | ||||
|    *      Internal Use Only. | ||||
|    ***************************************************************************/ | ||||
| typedef pthread_t ithread_t;  | ||||
|   typedef pthread_t ithread_t;  | ||||
|    | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Name: ithread_attr_t | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -84,20 +79,20 @@ typedef pthread_t ithread_t; | ||||
|    *      typedef to pthread_attr_t | ||||
|    *      Internal Use Only | ||||
|    ***************************************************************************/ | ||||
| typedef pthread_attr_t ithread_attr_t;	 | ||||
|   typedef pthread_attr_t ithread_attr_t;	 | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Name: start_routine | ||||
|    * | ||||
|    *  Description: | ||||
|    *      Thread start routine  | ||||
|    *      Internal Use Only. | ||||
|    ***************************************************************************/ | ||||
| typedef void * (*start_routine) (void *arg); | ||||
|   typedef void * (*start_routine) (void *arg); | ||||
|  | ||||
|    | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Name: ithread_cond_t | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -105,10 +100,10 @@ typedef void * (*start_routine) (void *arg); | ||||
|    *      typedef to pthread_cond_t | ||||
|    *      Internal Use Only. | ||||
|    ***************************************************************************/ | ||||
| typedef pthread_cond_t ithread_cond_t; | ||||
|   typedef pthread_cond_t ithread_cond_t; | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Name: ithread_mutexattr_t | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -116,10 +111,10 @@ typedef pthread_cond_t ithread_cond_t; | ||||
|    *      typedef to pthread_mutexattr_t | ||||
|    *      Internal Use Only | ||||
|    ***************************************************************************/ | ||||
| typedef pthread_mutexattr_t ithread_mutexattr_t;	 | ||||
|   typedef pthread_mutexattr_t ithread_mutexattr_t;	 | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Name: ithread_mutex_t | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -127,10 +122,10 @@ typedef pthread_mutexattr_t ithread_mutexattr_t; | ||||
|    *      typedef to pthread_mutex_t | ||||
|    *      Internal Use Only. | ||||
|    ***************************************************************************/ | ||||
| typedef pthread_mutex_t ithread_mutex_t; | ||||
|   typedef pthread_mutex_t ithread_mutex_t; | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Name: ithread_condattr_t | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -139,31 +134,9 @@ typedef pthread_mutex_t ithread_mutex_t; | ||||
|    *      NOT USED | ||||
|    *      Internal Use Only | ||||
|    ***************************************************************************/ | ||||
| typedef pthread_condattr_t ithread_condattr_t;	 | ||||
|   typedef pthread_condattr_t ithread_condattr_t;	 | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Name: ithread_rwlockattr_t | ||||
|  * | ||||
|  *  Description: | ||||
|  *      Mutex attribute. | ||||
|  *      typedef to pthread_rwlockattr_t | ||||
|  *      Internal Use Only | ||||
|  ***************************************************************************/ | ||||
| typedef pthread_rwlockattr_t ithread_rwlockattr_t;	 | ||||
|  | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Name: ithread_rwlock_t | ||||
|  * | ||||
|  *  Description: | ||||
|  *      Condition attribute. | ||||
|  *      typedef to pthread_rwlock_t | ||||
|  *      Internal Use Only | ||||
|  ***************************************************************************/ | ||||
| typedef pthread_rwlock_t ithread_rwlock_t;	 | ||||
|  | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Function: ithread_mutexattr_init | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -177,10 +150,10 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|    *      Always returns 0. | ||||
|    *      See man page for pthread_mutexattr_init | ||||
|    ***************************************************************************/ | ||||
|    | ||||
| #define ithread_mutexattr_init pthread_mutexattr_init | ||||
|    | ||||
|  | ||||
| /**************************************************************************** | ||||
|   /**************************************************************************** | ||||
|    * Function: ithread_mutexattr_destroy | ||||
|    * | ||||
|    *  Description: | ||||
| @@ -207,7 +180,7 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *                       ITHREAD_MUTEX_ERRORCHECK_NP | ||||
|  * | ||||
|  *  Parameters: | ||||
|  *      ithread_mutexattr_t * attr (must be valid non NULL pointer to  | ||||
|  *      ithread_mutexattr_t * mutex (must be valid non NULL pointer to  | ||||
|  *                                   ithread_mutexattr_t) | ||||
|  *      int kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP | ||||
|  *                or ITHREAD_MUTEX_ERRORCHECK_NP) | ||||
| @@ -217,9 +190,9 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *      See man page for pthread_mutexattr_setkind_np | ||||
|  *****************************************************************************/ | ||||
| #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 | ||||
|  | ||||
| /**************************************************************************** | ||||
| @@ -232,7 +205,7 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *                       ITHREAD_MUTEX_ERRORCHECK_NP | ||||
|  * | ||||
|  *  Parameters: | ||||
|  *      ithread_mutexattr_t * attr (must be valid non NULL pointer to  | ||||
|  *      ithread_mutexattr_t * mutex (must be valid non NULL pointer to  | ||||
|  *                                   pthread_mutexattr_t) | ||||
|  *      int *kind (one of ITHREAD_MUTEX_FAST_NP or ITHREAD_MUTEX_RECURSIVE_NP | ||||
|  *                or ITHREAD_MUTEX_ERRORCHECK_NP) | ||||
| @@ -242,9 +215,9 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *      See man page for pthread_mutexattr_getkind_np | ||||
|  *****************************************************************************/ | ||||
| #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 | ||||
|  | ||||
|    | ||||
| @@ -265,7 +238,6 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *****************************************************************************/ | ||||
| #define ithread_mutex_init pthread_mutex_init | ||||
|    | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: ithread_mutex_lock | ||||
|  * | ||||
| @@ -320,169 +292,6 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
| #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 | ||||
|  * | ||||
| @@ -715,11 +524,7 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *		0 on success, Nonzero on failure. | ||||
|  *              See man page for sleep (man 3 sleep) | ||||
|  *****************************************************************************/ | ||||
| #ifndef WIN32 | ||||
| #define isleep sleep | ||||
| #else | ||||
| #define isleep(x) Sleep((x)*1000) | ||||
| #endif | ||||
|  | ||||
| /**************************************************************************** | ||||
|  * Function: isleep | ||||
| @@ -734,11 +539,7 @@ typedef pthread_rwlock_t ithread_rwlock_t; | ||||
|  *		0 on success, Nonzero on failure. | ||||
|  *              See man page for sleep (man 3 sleep) | ||||
|  *****************************************************************************/ | ||||
| #ifndef WIN32 | ||||
| #define imillisleep(x) usleep(1000*x) | ||||
| #else | ||||
| #define imillisleep	Sleep | ||||
| #endif | ||||
|  | ||||
| #ifdef WIN32 | ||||
| 	#ifndef UPNP_STATIC_LIB | ||||
|   | ||||
| @@ -30,13 +30,11 @@ | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| #include "LinkedList.h" | ||||
| #ifndef WIN32 | ||||
| 	#include <sys/param.h> | ||||
| #endif | ||||
| #if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__) | ||||
| 	#include <stdlib.h> | ||||
| #include <sys/param.h> | ||||
| #if (defined(BSD) && BSD >= 199306) | ||||
| #include <stdlib.h> | ||||
| #else | ||||
| 	#include <malloc.h> | ||||
| #include <malloc.h> | ||||
| #endif | ||||
| #include <assert.h> | ||||
|  | ||||
| @@ -534,4 +532,3 @@ ListSize( LinkedList * list ) | ||||
|  | ||||
|     return list->size; | ||||
| } | ||||
|  | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										153
									
								
								threadutil/src/iasnprintf.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										153
									
								
								threadutil/src/iasnprintf.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,153 @@ | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
| // | ||||
| // Copyright (c) 2000-2003 Intel Corporation  | ||||
| // All rights reserved.  | ||||
| // | ||||
| // Redistribution and use in source and binary forms, with or without  | ||||
| // modification, are permitted provided that the following conditions are met:  | ||||
| // | ||||
| // * Redistributions of source code must retain the above copyright notice,  | ||||
| // this list of conditions and the following disclaimer.  | ||||
| // * Redistributions in binary form must reproduce the above copyright notice,  | ||||
| // this list of conditions and the following disclaimer in the documentation  | ||||
| // and/or other materials provided with the distribution.  | ||||
| // * Neither name of Intel Corporation nor the names of its contributors  | ||||
| // may be used to endorse or promote products derived from this software  | ||||
| // without specific prior written permission. | ||||
| //  | ||||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  | ||||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT  | ||||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  | ||||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR  | ||||
| // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  | ||||
| // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,  | ||||
| // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR  | ||||
| // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY  | ||||
| // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||||
| // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS  | ||||
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| // | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| #include <stdarg.h> | ||||
| #include <assert.h> | ||||
| #include <sys/param.h> | ||||
| #if (defined(BSD) && BSD >= 199306) | ||||
| #include <stdlib.h> | ||||
| #else | ||||
| #include <malloc.h> | ||||
| #endif | ||||
| #include <stdio.h> | ||||
| #include "iasnprintf.h" | ||||
|  | ||||
| #ifndef NULL | ||||
| #define NULL 0 | ||||
| #endif | ||||
|  | ||||
| #ifdef WIN32 | ||||
|  #define vsnprintf _vsnprintf | ||||
| #endif | ||||
|  | ||||
| /** | ||||
|  * Allocates enough memory for the | ||||
|  * Formatted string, up to max | ||||
|  * specified. | ||||
|  * With max set to -1, it allocates as | ||||
|  * much size as needed. | ||||
|  * Memory must be freed using free. | ||||
|  */ | ||||
|  | ||||
| int | ||||
| iasnprintf( char **ret, | ||||
|             int incr, | ||||
|             int max, | ||||
|             const char *fmt, | ||||
|             ... ) | ||||
| { | ||||
|     int size = incr; | ||||
|     int retc = 0; | ||||
|     va_list ap; | ||||
|     char *temp = NULL; | ||||
|  | ||||
|     assert( ret ); | ||||
|     assert( fmt ); | ||||
|     ( *ret ) = ( char * )malloc( incr ); | ||||
|  | ||||
|     if( ( *ret ) == NULL ) return -1; | ||||
|  | ||||
|     while( 1 ) { | ||||
|         va_start( ap, fmt ); | ||||
|         retc = vsnprintf( ( *ret ), size, fmt, ap ); | ||||
|         va_end( ap ); | ||||
|  | ||||
|         if( retc < 0 ) { | ||||
|             //size not big enough | ||||
|             //and vsnprintf does NOT return the | ||||
|             //necessary number of bytes | ||||
|             if( ( max != -1 ) && ( size == max ) )  //max reached | ||||
|             { | ||||
|                 break; | ||||
|             } | ||||
|  | ||||
|             incr *= 2;          //increase increment | ||||
|             //increase size and try again   | ||||
|             if( ( max != -1 ) && ( ( size + incr ) > max ) ) { | ||||
|                 incr = ( max - size ); | ||||
|             } | ||||
|  | ||||
|             temp = ( char * )realloc( ( *ret ), size + incr ); | ||||
|             if( temp == NULL ) { | ||||
|                 break; | ||||
|             } | ||||
|             size += incr; | ||||
|             ( *ret ) = temp; | ||||
|  | ||||
|         } else { | ||||
|             if( ( retc + 1 ) > size ) { | ||||
|                 //size not big enough | ||||
|                 //and vsnprintf  | ||||
|                 //returns the necessary  | ||||
|                 //number of bytes | ||||
|                 if( ( max != -1 ) && ( retc + 1 > max ) ) { | ||||
|                     retc = -1; | ||||
|                     break; | ||||
|                 } | ||||
|  | ||||
|                 temp = ( char * )realloc( ( *ret ), retc + 1 ); | ||||
|                 if( temp == NULL ) { | ||||
|                     retc = -1; | ||||
|                     break; | ||||
|                 } | ||||
|                 size = retc + 1; | ||||
|                 ( *ret ) = temp;    //size increased try again | ||||
|             } else if( ( retc + 1 ) < size ) { | ||||
|                 //size is bigger than needed | ||||
|                 //try and reallocate smaller | ||||
|  | ||||
|                 temp = ( char * )realloc( ( *ret ), retc + 1 ); | ||||
|                 if( temp != NULL ) { | ||||
|                     ( *ret ) = temp; | ||||
|                 } | ||||
|                 break; | ||||
|             } else              //size is just right, exit | ||||
|             { | ||||
|                 break; | ||||
|             } | ||||
|  | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if( retc < 0 ) { | ||||
|         free( ( *ret ) ); | ||||
|         ( *ret ) = NULL; | ||||
|     } | ||||
|  | ||||
|     return retc; | ||||
| } | ||||
|  | ||||
| void | ||||
| iasnprintfFree( char *fChar ) | ||||
| { | ||||
|     free( fChar ); | ||||
|     fChar = NULL; | ||||
| } | ||||
| @@ -11,6 +11,10 @@ AM_CPPFLAGS = \ | ||||
| 	-I$(top_srcdir)/threadutil/inc \ | ||||
| 	-I$(top_srcdir)/ixml/inc | ||||
|  | ||||
| AM_CFLAGS = $(PTHREAD_CFLAGS) | ||||
|  | ||||
| AM_LDFLAGS = $(PTHREAD_LIBS) | ||||
|  | ||||
| LDADD = \ | ||||
| 	libupnp.la \ | ||||
| 	$(top_builddir)/threadutil/libthreadutil.la \ | ||||
|   | ||||
| @@ -47,9 +47,7 @@ | ||||
|  | ||||
|  | ||||
| #include <stdio.h> | ||||
| #ifndef WIN32 | ||||
| 	#include <sys/param.h> | ||||
| #endif | ||||
| #include <sys/param.h> | ||||
| #if (defined(BSD) && BSD >= 199306) | ||||
| 	#include <time.h> | ||||
| #endif | ||||
| @@ -104,6 +102,8 @@ | ||||
| 	#define UpnpCloseSocket closesocket | ||||
| 	#define fseeko fseek | ||||
| #endif | ||||
| #define UPNP_SOCKETERROR -1 | ||||
| #define UPNP_INVALID_SOCKET -1 | ||||
| #ifndef WIN32 | ||||
| 	#define SOCKET int | ||||
| #endif | ||||
| @@ -413,7 +413,7 @@ | ||||
| #define UPNP_E_SUBSCRIBE_UNACCEPTED   -301 | ||||
| /*! @} */ | ||||
|  | ||||
| /** @name UPNP_E_UNSUBSCRIBE_UNACCEPTED [-302] | ||||
| /** @name UPNP_E_UNSUBSCRIBE_UNACCAPTED [-302] | ||||
|  *  {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED} signifies that an unsubscribe | ||||
|  *  request was rejected from the remote side. | ||||
|  */ | ||||
|   | ||||
| @@ -258,7 +258,7 @@ void UpnpPrintf( | ||||
| 	__attribute__((format (__printf__, 5, 6))) | ||||
| #endif | ||||
| ; | ||||
| #else /* DEBUG */ | ||||
| #else | ||||
| static UPNP_INLINE void UpnpPrintf( | ||||
| 	Upnp_LogLevel DLevel, | ||||
| 	Dbg_Module Module, | ||||
| @@ -266,7 +266,7 @@ static UPNP_INLINE void UpnpPrintf( | ||||
| 	int DbgLineNo, | ||||
| 	const char* FmtStr, | ||||
| 	...) {} | ||||
| #endif /* DEBUG */ | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /*************************************************************************** | ||||
|   | ||||
| @@ -9,6 +9,10 @@ AM_CPPFLAGS = \ | ||||
| 	-I$(top_srcdir)/threadutil/inc \ | ||||
| 	-I$(top_srcdir)/ixml/inc | ||||
|  | ||||
| AM_CFLAGS = $(PTHREAD_CFLAGS) | ||||
|  | ||||
| AM_LDFLAGS = $(PTHREAD_LIBS) | ||||
|  | ||||
| LDADD = \ | ||||
| 	$(top_builddir)/upnp/libupnp.la \ | ||||
| 	$(top_builddir)/threadutil/libthreadutil.la \ | ||||
|   | ||||
| @@ -105,7 +105,7 @@ SampleUtil_RegisterUpdateFunction( state_update update_function ) | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int | ||||
| SampleUtil_Finish() | ||||
| SampleUtil_Finish(  ) | ||||
| { | ||||
|     ithread_mutex_destroy( &display_mutex ); | ||||
|     gPrintFun = NULL; | ||||
|   | ||||
| @@ -34,26 +34,24 @@ | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif /* __cplusplus */ | ||||
|  | ||||
| #endif | ||||
|  | ||||
| #include <stdlib.h> | ||||
|  | ||||
| #include <string.h> | ||||
|  | ||||
| #include "upnptools.h" | ||||
| #include "ithread.h" | ||||
| #include "ixml.h" | ||||
| #include "upnptools.h" | ||||
|  | ||||
|  | ||||
| // mutex to control displaying of events | ||||
| extern ithread_mutex_t display_mutex; | ||||
|  | ||||
| //mutex to control displaying of events | ||||
| extern ithread_mutex_t display_mutex ; | ||||
|  | ||||
| typedef enum { | ||||
| 	STATE_UPDATE = 0, | ||||
| 	DEVICE_ADDED = 1, | ||||
| 	DEVICE_REMOVED = 2, | ||||
| 	GET_VAR_COMPLETE = 3 | ||||
| 	DEVICE_ADDED =1, | ||||
| 	DEVICE_REMOVED=2, | ||||
| 	GET_VAR_COMPLETE=3 | ||||
| } eventType; | ||||
|  | ||||
|  | ||||
| @@ -70,7 +68,7 @@ typedef enum { | ||||
|  *   node -- The DOM node from which to extract the value | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| char *SampleUtil_GetElementValue(IN IXML_Element *element); | ||||
| char * SampleUtil_GetElementValue(IN IXML_Element *element); | ||||
|  | ||||
| /******************************************************************************** | ||||
|  * SampleUtil_GetFirstServiceList | ||||
| @@ -87,7 +85,7 @@ char *SampleUtil_GetElementValue(IN IXML_Element *element); | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
|  | ||||
| IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document *doc);  | ||||
| IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document * doc);  | ||||
|  | ||||
|  | ||||
| /******************************************************************************** | ||||
| @@ -102,7 +100,7 @@ IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document *doc); | ||||
|  *   item -- The item to search for | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| char *SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item);  | ||||
| char * SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item);  | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -118,7 +116,7 @@ char *SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item | ||||
|  *   item -- The item to search for | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| char *SampleUtil_GetFirstElementItem(IN IXML_Element *element, IN const char *item);  | ||||
| char * SampleUtil_GetFirstElementItem(IN IXML_Element *element, IN const char *item);  | ||||
|  | ||||
| /******************************************************************************** | ||||
|  * SampleUtil_PrintEventType | ||||
| @@ -164,13 +162,9 @@ int SampleUtil_PrintEvent(IN Upnp_EventType EventType, | ||||
|  *   controlURL -- OUT -- The control URL for the service | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int SampleUtil_FindAndParseService ( | ||||
| 	IN IXML_Document *DescDoc, | ||||
| 	IN char* location,  | ||||
| 	IN char *serviceType, | ||||
| 	OUT char **serviceId,  | ||||
| 	OUT char **eventURL, | ||||
| 	OUT char **controlURL); | ||||
| int SampleUtil_FindAndParseService (IN IXML_Document *DescDoc, IN char* location,  | ||||
| 				    IN char *serviceType, OUT char **serviceId,  | ||||
| 				    OUT char **eventURL, OUT char **controlURL); | ||||
|  | ||||
|  | ||||
| /******************************************************************************** | ||||
| @@ -202,10 +196,7 @@ extern print_string gPrintFun; | ||||
|  *   const char * UDN | ||||
|  *   int          newDevice | ||||
|  ********************************************************************************/ | ||||
| typedef void (*state_update)( | ||||
| 	const char *varName, | ||||
| 	const char *varValue, | ||||
| 	const char *UDN, | ||||
| typedef void (*state_update)( const char *varName, const char *varValue, const char *UDN, | ||||
| 							 eventType type); | ||||
|  | ||||
| //global state update function used by smaple util | ||||
| @@ -233,7 +224,7 @@ int SampleUtil_Initialize(print_string print_function); | ||||
|  * Parameters: | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int SampleUtil_Finish(); | ||||
| int SampleUtil_Finish(void); | ||||
|  | ||||
| /******************************************************************************** | ||||
|  * SampleUtil_Print | ||||
| @@ -247,7 +238,7 @@ int SampleUtil_Finish(); | ||||
|  *   . . .  - variable number of args. (see printf) | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int SampleUtil_Print(char *fmt, ...); | ||||
| int SampleUtil_Print( char *fmt, ... ); | ||||
|  | ||||
| /******************************************************************************** | ||||
|  * SampleUtil_RegisterUpdateFunction | ||||
| @@ -257,7 +248,7 @@ int SampleUtil_Print(char *fmt, ...); | ||||
|  * Parameters: | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int SampleUtil_RegisterUpdateFunction(state_update update_function); | ||||
| int SampleUtil_RegisterUpdateFunction( state_update update_function ); | ||||
|  | ||||
| /******************************************************************************** | ||||
|  * SampleUtil_StateUpdate | ||||
| @@ -267,22 +258,11 @@ int SampleUtil_RegisterUpdateFunction(state_update update_function); | ||||
|  * Parameters: | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| void SampleUtil_StateUpdate( | ||||
| 	const char *varName, | ||||
| 	const char *varValue, | ||||
| 	const char *UDN, | ||||
| void SampleUtil_StateUpdate( const char *varName, const char *varValue, const char *UDN, | ||||
| 							eventType type); | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| }; | ||||
| #endif /* __cplusplus */ | ||||
|  | ||||
|  | ||||
| #ifdef WIN32 | ||||
| 	#define snprintf	_snprintf | ||||
| 	#define strcasecmp	stricmp | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #endif /* SAMPLE_UTIL_H */ | ||||
|  | ||||
| #endif /* UPNPSDK_UTIL_H */ | ||||
|   | ||||
| @@ -449,17 +449,17 @@ device_main( int argc, char **argv ) | ||||
|  | ||||
|     port = ( unsigned short )portTemp; | ||||
|  | ||||
|     return TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print ); | ||||
|     return TvDeviceStart( | ||||
|         ip_address, port, desc_doc_name, web_dir_path, linux_print ); | ||||
| } | ||||
|  | ||||
| int main( int argc, char **argv ) | ||||
| int | ||||
| main( int argc, char **argv ) | ||||
| { | ||||
|     int rc; | ||||
|     ithread_t cmdloop_thread; | ||||
| #ifndef WIN32 | ||||
|     int sig; | ||||
|     sigset_t sigs_to_catch; | ||||
| #endif | ||||
|     int code; | ||||
|  | ||||
|     device_main(argc, argv); | ||||
| @@ -468,10 +468,11 @@ int main( int argc, char **argv ) | ||||
|         SampleUtil_Print( "Error starting UPnP TV Control Point" ); | ||||
|         return rc; | ||||
|     } | ||||
|     /* start a command loop thread */ | ||||
|     code = ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL ); | ||||
|     // start a command loop thread | ||||
|     code = | ||||
|         ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, | ||||
|                         NULL ); | ||||
|  | ||||
| #ifndef WIN32 | ||||
|     /* | ||||
|        Catch Ctrl-C and properly shutdown  | ||||
|      */ | ||||
| @@ -479,10 +480,7 @@ int main( int argc, char **argv ) | ||||
|     sigaddset( &sigs_to_catch, SIGINT ); | ||||
|     sigwait( &sigs_to_catch, &sig ); | ||||
|  | ||||
|     SampleUtil_Print( "Shutting down on signal %d...\n", sig ); | ||||
| #else | ||||
| 	ithread_join(cmdloop_thread, NULL); | ||||
| #endif | ||||
|     SampleUtil_Print( "Shutting down on signal %d...", sig ); | ||||
|     TvDeviceStop(); | ||||
|     rc = TvCtrlPointStop(); | ||||
|      | ||||
|   | ||||
| @@ -224,7 +224,7 @@ TvCtrlPointRefresh( void ) | ||||
| { | ||||
|     int rc; | ||||
|  | ||||
|     TvCtrlPointRemoveAll(); | ||||
|     TvCtrlPointRemoveAll(  ); | ||||
|  | ||||
|     /* | ||||
|        Search for all devices of type tvdevice version 1,  | ||||
| @@ -539,7 +539,7 @@ TvCtrlPointGetDevice( int devnum, | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int | ||||
| TvCtrlPointPrintList() | ||||
| TvCtrlPointPrintList(  ) | ||||
| { | ||||
|     struct TvDeviceNode *tmpdevnode; | ||||
|     int i = 0; | ||||
| @@ -1096,7 +1096,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType, | ||||
|                 if( DescDoc ) | ||||
|                     ixmlDocument_free( DescDoc ); | ||||
|  | ||||
|                 TvCtrlPointPrintList(); | ||||
|                 TvCtrlPointPrintList(  ); | ||||
|                 break; | ||||
|             } | ||||
|  | ||||
| @@ -1122,7 +1122,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType, | ||||
|                 TvCtrlPointRemoveDevice( d_event->DeviceId ); | ||||
|  | ||||
|                 SampleUtil_Print( "After byebye:" ); | ||||
|                 TvCtrlPointPrintList(); | ||||
|                 TvCtrlPointPrintList(  ); | ||||
|  | ||||
|                 break; | ||||
|             } | ||||
| @@ -1354,7 +1354,7 @@ TvCtrlPointStart( print_string printFunctionPtr, | ||||
| { | ||||
|     ithread_t timer_thread; | ||||
|     int rc; | ||||
|     unsigned short port = 0; | ||||
|     short int port = 0; | ||||
|     char *ip_address = NULL; | ||||
|  | ||||
|     SampleUtil_Initialize( printFunctionPtr ); | ||||
| @@ -1362,42 +1362,34 @@ TvCtrlPointStart( print_string printFunctionPtr, | ||||
|  | ||||
|     ithread_mutex_init( &DeviceListMutex, 0 ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "Initializing UPnP Sdk with\n" | ||||
|         "\tipaddress = %s port = %u\n", | ||||
|     SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d", | ||||
|                       ip_address, port ); | ||||
|  | ||||
|     rc = UpnpInit( ip_address, port ); | ||||
|     if( UPNP_E_SUCCESS != rc ) { | ||||
|         SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc ); | ||||
|         //UpnpFinish(); | ||||
|         //UpnpFinish(  ); | ||||
|         //return TV_ERROR; | ||||
|     } | ||||
|  | ||||
|     if( NULL == ip_address ) { | ||||
|         ip_address = UpnpGetServerIpAddress(); | ||||
|     } | ||||
|     if( 0 == port ) { | ||||
|         port = UpnpGetServerPort(); | ||||
|     } | ||||
|     if( NULL == ip_address ) | ||||
|         ip_address = UpnpGetServerIpAddress(  ); | ||||
|     if( 0 == port ) | ||||
|         port = UpnpGetServerPort(  ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "UPnP Initialized\n" | ||||
| 	"\tipaddress= %s port = %u\n", | ||||
|         ip_address, port ); | ||||
|     SampleUtil_Print( "UPnP Initialized (%s:%d)", ip_address, port ); | ||||
|  | ||||
|     SampleUtil_Print( "Registering Control Point" ); | ||||
|     rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler, | ||||
|                              &ctrlpt_handle, &ctrlpt_handle ); | ||||
|     if( UPNP_E_SUCCESS != rc ) { | ||||
|         SampleUtil_Print( "Error registering CP: %d", rc ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return TV_ERROR; | ||||
|     } | ||||
|  | ||||
|     SampleUtil_Print( "Control Point Registered" ); | ||||
|  | ||||
|     TvCtrlPointRefresh(); | ||||
|     TvCtrlPointRefresh(  ); | ||||
|  | ||||
|     // start a timer thread | ||||
|     ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL ); | ||||
| @@ -1408,10 +1400,10 @@ TvCtrlPointStart( print_string printFunctionPtr, | ||||
| int | ||||
| TvCtrlPointStop( void ) | ||||
| { | ||||
|     TvCtrlPointRemoveAll(); | ||||
|     TvCtrlPointRemoveAll(  ); | ||||
|     UpnpUnRegisterClient( ctrlpt_handle ); | ||||
|     UpnpFinish(); | ||||
|     SampleUtil_Finish(); | ||||
|     UpnpFinish(  ); | ||||
|     SampleUtil_Finish(  ); | ||||
|  | ||||
|     return TV_SUCCESS; | ||||
| } | ||||
|   | ||||
| @@ -39,9 +39,7 @@ extern "C" { | ||||
| #include <stdio.h> | ||||
|  | ||||
| #include "ithread.h" | ||||
| #ifndef WIN32 | ||||
| #include <unistd.h> | ||||
| #endif | ||||
| #include <stdarg.h> | ||||
| #include <stdlib.h> | ||||
| #include <signal.h> | ||||
|   | ||||
| @@ -1913,11 +1913,11 @@ TvDeviceCallbackEventHandler( Upnp_EventType EventType, | ||||
|  * | ||||
|  *****************************************************************************/ | ||||
| int | ||||
| TvDeviceStop() | ||||
| TvDeviceStop(  ) | ||||
| { | ||||
|     UpnpUnRegisterRootDevice( device_handle ); | ||||
|     UpnpFinish(); | ||||
|     SampleUtil_Finish(); | ||||
|     UpnpFinish(  ); | ||||
|     SampleUtil_Finish(  ); | ||||
|     ithread_mutex_destroy( &TVDevMutex ); | ||||
|     return UPNP_E_SUCCESS; | ||||
| } | ||||
| @@ -1958,37 +1958,32 @@ TvDeviceStart( char *ip_address, | ||||
|  | ||||
|     SampleUtil_Initialize( pfun ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "Initializing UPnP Sdk with\n" | ||||
|         "\tipaddress = %s port = %u\n", | ||||
|     SampleUtil_Print | ||||
|         ( "Initializing UPnP Sdk with \n \t ipaddress = %s port = %d\n", | ||||
|           ip_address, port ); | ||||
|  | ||||
|     if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) { | ||||
|         SampleUtil_Print( "Error with UpnpInit -- %d\n", ret ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     if( ip_address == NULL ) { | ||||
|         ip_address = UpnpGetServerIpAddress(); | ||||
|         ip_address = UpnpGetServerIpAddress(  ); | ||||
|     } | ||||
|  | ||||
|     if( port == 0 ) { | ||||
|         port = UpnpGetServerPort(); | ||||
|         port = UpnpGetServerPort(  ); | ||||
|     } | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "UPnP Initialized\n" | ||||
| 	"\tipaddress= %s port = %u\n", | ||||
|     SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n", | ||||
|                       ip_address, port ); | ||||
|  | ||||
|     if( desc_doc_name == NULL ) { | ||||
|     if( desc_doc_name == NULL ) | ||||
|         desc_doc_name = "tvcombodesc.xml"; | ||||
|     } | ||||
|  | ||||
|     if( web_dir_path == NULL ) { | ||||
|     if( web_dir_path == NULL ) | ||||
|         web_dir_path = DEFAULT_WEB_DIR; | ||||
|     } | ||||
|  | ||||
|     snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address, | ||||
|               port, desc_doc_name ); | ||||
| @@ -2000,13 +1995,12 @@ TvDeviceStart( char *ip_address, | ||||
|         SampleUtil_Print | ||||
|             ( "Error specifying webserver root directory -- %s: %d\n", | ||||
|               web_dir_path, ret ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "Registering the RootDevice\n" | ||||
|         "\t with desc_doc_url: %s\n", | ||||
|     SampleUtil_Print | ||||
|         ( "Registering the RootDevice\n\t with desc_doc_url: %s\n", | ||||
|           desc_doc_url ); | ||||
|  | ||||
|     if( ( ret = UpnpRegisterRootDevice( desc_doc_url, | ||||
| @@ -2014,25 +2008,24 @@ TvDeviceStart( char *ip_address, | ||||
|                                         &device_handle, &device_handle ) ) | ||||
|         != UPNP_E_SUCCESS ) { | ||||
|         SampleUtil_Print( "Error registering the rootdevice : %d\n", ret ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return ret; | ||||
|     } else { | ||||
|         SampleUtil_Print( | ||||
|             "RootDevice Registered\n" | ||||
|             "Initializing State Table\n"); | ||||
|         SampleUtil_Print( "RootDevice Registered\n" ); | ||||
|  | ||||
|         SampleUtil_Print( "Initializing State Table\n" ); | ||||
|         TvDeviceStateTableInit( desc_doc_url ); | ||||
|         SampleUtil_Print("State Table Initialized\n"); | ||||
|         SampleUtil_Print( "State Table Initialized\n" ); | ||||
|  | ||||
|         if( ( ret = | ||||
|               UpnpSendAdvertisement( device_handle, default_advr_expire ) ) | ||||
|             != UPNP_E_SUCCESS ) { | ||||
|             SampleUtil_Print( "Error sending advertisements : %d\n", ret ); | ||||
|             UpnpFinish(); | ||||
|             UpnpFinish(  ); | ||||
|             return ret; | ||||
|         } | ||||
|  | ||||
|         SampleUtil_Print("Advertisements Sent\n"); | ||||
|         SampleUtil_Print( "Advertisements Sent\n" ); | ||||
|     } | ||||
|     return UPNP_E_SUCCESS; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -41,9 +41,7 @@ extern "C" { | ||||
|  | ||||
| #include "ithread.h" | ||||
| #include <stdlib.h> | ||||
| #ifndef WIN32 | ||||
| #include <unistd.h> | ||||
| #endif | ||||
| #include <string.h> | ||||
| #include "upnp.h" | ||||
| #include "sample_util.h" | ||||
|   | ||||
| @@ -29,12 +29,9 @@ | ||||
| // | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|  | ||||
| #include <stdio.h> | ||||
| #include "sample_util.h" | ||||
| #include "upnp_tv_ctrlpt.h" | ||||
|  | ||||
|  | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| /* | ||||
| @@ -127,72 +124,108 @@ TvCtrlPointPrintLongHelp( void ) | ||||
|     SampleUtil_Print( "* TV Control Point Help Info *" ); | ||||
|     SampleUtil_Print( "******************************" ); | ||||
|     SampleUtil_Print( "" ); | ||||
|     SampleUtil_Print( "This sample control point application automatically searches" ); | ||||
|     SampleUtil_Print( "for and subscribes to the services of television device emulator" ); | ||||
|     SampleUtil_Print( "devices, described in the tvdevicedesc.xml description document." ); | ||||
|     SampleUtil_Print | ||||
|         ( "This sample control point application automatically searches" ); | ||||
|     SampleUtil_Print | ||||
|         ( "for and subscribes to the services of television device emulator" ); | ||||
|     SampleUtil_Print | ||||
|         ( "devices, described in the tvdevicedesc.xml description document." ); | ||||
|     SampleUtil_Print( "" ); | ||||
|     SampleUtil_Print( "Commands:" ); | ||||
|     SampleUtil_Print( "  Help" ); | ||||
|     SampleUtil_Print( "       Print this help info." ); | ||||
|     SampleUtil_Print( "  ListDev" ); | ||||
|     SampleUtil_Print( "       Print the current list of TV Device Emulators that this" ); | ||||
|     SampleUtil_Print( "         control point is aware of.  Each device is preceded by a" ); | ||||
|     SampleUtil_Print( "         device number which corresponds to the devnum argument of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Print the current list of TV Device Emulators that this" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         control point is aware of.  Each device is preceded by a" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device number which corresponds to the devnum argument of" ); | ||||
|     SampleUtil_Print( "         commands listed below." ); | ||||
|     SampleUtil_Print( "  Refresh" ); | ||||
|     SampleUtil_Print( "       Delete all of the devices from the device list and issue new" ); | ||||
|     SampleUtil_Print( "         search request to rebuild the list from scratch." ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Delete all of the devices from the device list and issue new" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         search request to rebuild the list from scratch." ); | ||||
|     SampleUtil_Print( "  PrintDev       <devnum>" ); | ||||
|     SampleUtil_Print( "       Print the state table for the device <devnum>." ); | ||||
|     SampleUtil_Print( "         e.g., 'PrintDev 1' prints the state table for the first" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Print the state table for the device <devnum>." ); | ||||
|     SampleUtil_Print | ||||
|         ( "         e.g., 'PrintDev 1' prints the state table for the first" ); | ||||
|     SampleUtil_Print( "         device in the device list." ); | ||||
|     SampleUtil_Print( "  PowerOn        <devnum>" ); | ||||
|     SampleUtil_Print( "       Sends the PowerOn action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the PowerOn action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>." ); | ||||
|     SampleUtil_Print( "  PowerOff       <devnum>" ); | ||||
|     SampleUtil_Print( "       Sends the PowerOff action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the PowerOff action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>." ); | ||||
|     SampleUtil_Print( "  SetChannel     <devnum> <channel>" ); | ||||
|     SampleUtil_Print( "       Sends the SetChannel action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>, requesting the channel to be changed" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the SetChannel action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device <devnum>, requesting the channel to be changed" ); | ||||
|     SampleUtil_Print( "         to <channel>." ); | ||||
|     SampleUtil_Print( "  SetVolume      <devnum> <volume>" ); | ||||
|     SampleUtil_Print( "       Sends the SetVolume action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>, requesting the volume to be changed" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the SetVolume action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device <devnum>, requesting the volume to be changed" ); | ||||
|     SampleUtil_Print( "         to <volume>." ); | ||||
|     SampleUtil_Print( "  SetColor       <devnum> <color>" ); | ||||
|     SampleUtil_Print( "       Sends the SetColor action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>, requesting the color to be changed" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the SetColor action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device <devnum>, requesting the color to be changed" ); | ||||
|     SampleUtil_Print( "         to <color>." ); | ||||
|     SampleUtil_Print( "  SetTint        <devnum> <tint>" ); | ||||
|     SampleUtil_Print( "       Sends the SetTint action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>, requesting the tint to be changed" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the SetTint action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device <devnum>, requesting the tint to be changed" ); | ||||
|     SampleUtil_Print( "         to <tint>." ); | ||||
|     SampleUtil_Print( "  SetContrast    <devnum> <contrast>" ); | ||||
|     SampleUtil_Print( "       Sends the SetContrast action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>, requesting the contrast to be changed" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the SetContrast action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device <devnum>, requesting the contrast to be changed" ); | ||||
|     SampleUtil_Print( "         to <contrast>." ); | ||||
|     SampleUtil_Print( "  SetBrightness  <devnum> <brightness>" ); | ||||
|     SampleUtil_Print( "       Sends the SetBrightness action to the Control Service of" ); | ||||
|     SampleUtil_Print( "         device <devnum>, requesting the brightness to be changed" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends the SetBrightness action to the Control Service of" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         device <devnum>, requesting the brightness to be changed" ); | ||||
|     SampleUtil_Print( "         to <brightness>." ); | ||||
|     SampleUtil_Print( "  CtrlAction     <devnum> <action>" ); | ||||
|     SampleUtil_Print( "       Sends an action request specified by the string <action>" ); | ||||
|     SampleUtil_Print( "         to the Control Service of device <devnum>.  This command" ); | ||||
|     SampleUtil_Print( "         only works for actions that have no arguments." ); | ||||
|     SampleUtil_Print( "         (e.g., \"CtrlAction 1 IncreaseChannel\")" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends an action request specified by the string <action>" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         to the Control Service of device <devnum>.  This command" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         only works for actions that have no arguments." ); | ||||
|     SampleUtil_Print | ||||
|         ( "         (e.g., \"CtrlAction 1 IncreaseChannel\")" ); | ||||
|     SampleUtil_Print( "  PictAction     <devnum> <action>" ); | ||||
|     SampleUtil_Print( "       Sends an action request specified by the string <action>" ); | ||||
|     SampleUtil_Print( "         to the Picture Service of device <devnum>.  This command" ); | ||||
|     SampleUtil_Print( "         only works for actions that have no arguments." ); | ||||
|     SampleUtil_Print( "         (e.g., \"PictAction 1 DecreaseContrast\")" ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Sends an action request specified by the string <action>" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         to the Picture Service of device <devnum>.  This command" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         only works for actions that have no arguments." ); | ||||
|     SampleUtil_Print | ||||
|         ( "         (e.g., \"PictAction 1 DecreaseContrast\")" ); | ||||
|     SampleUtil_Print( "  CtrlGetVar     <devnum> <varname>" ); | ||||
|     SampleUtil_Print( "       Requests the value of a variable specified by the string <varname>" ); | ||||
|     SampleUtil_Print( "         from the Control Service of device <devnum>." ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Requests the value of a variable specified by the string <varname>" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         from the Control Service of device <devnum>." ); | ||||
|     SampleUtil_Print( "         (e.g., \"CtrlGetVar 1 Volume\")" ); | ||||
|     SampleUtil_Print( "  PictGetVar     <devnum> <action>" ); | ||||
|     SampleUtil_Print( "       Requests the value of a variable specified by the string <varname>" ); | ||||
|     SampleUtil_Print( "         from the Picture Service of device <devnum>." ); | ||||
|     SampleUtil_Print | ||||
|         ( "       Requests the value of a variable specified by the string <varname>" ); | ||||
|     SampleUtil_Print | ||||
|         ( "         from the Picture Service of device <devnum>." ); | ||||
|     SampleUtil_Print( "         (e.g., \"PictGetVar 1 Tint\")" ); | ||||
|     SampleUtil_Print( "  Exit" ); | ||||
|     SampleUtil_Print( "       Exits the control point application." ); | ||||
| @@ -209,7 +242,7 @@ TvCtrlPointPrintLongHelp( void ) | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| void | ||||
| TvCtrlPointPrintCommands() | ||||
| TvCtrlPointPrintCommands(  ) | ||||
| { | ||||
|     int i; | ||||
|     int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands ); | ||||
| @@ -288,11 +321,11 @@ TvCtrlPointProcessCommand( char *cmdline ) | ||||
|  | ||||
|     switch ( cmdnum ) { | ||||
|         case PRTHELP: | ||||
|             TvCtrlPointPrintShortHelp(); | ||||
|             TvCtrlPointPrintShortHelp(  ); | ||||
|             break; | ||||
|  | ||||
|         case PRTFULLHELP: | ||||
|             TvCtrlPointPrintLongHelp(); | ||||
|             TvCtrlPointPrintLongHelp(  ); | ||||
|             break; | ||||
|  | ||||
|         case POWON: | ||||
| @@ -378,15 +411,15 @@ TvCtrlPointProcessCommand( char *cmdline ) | ||||
|             break; | ||||
|  | ||||
|         case LSTDEV: | ||||
|             TvCtrlPointPrintList(); | ||||
|             TvCtrlPointPrintList(  ); | ||||
|             break; | ||||
|  | ||||
|         case REFRESH: | ||||
|             TvCtrlPointRefresh(); | ||||
|             TvCtrlPointRefresh(  ); | ||||
|             break; | ||||
|  | ||||
|         case EXITCMD: | ||||
|             rc = TvCtrlPointStop(); | ||||
|             rc = TvCtrlPointStop(  ); | ||||
|             exit( rc ); | ||||
|             break; | ||||
|  | ||||
| @@ -407,23 +440,20 @@ main( int argc, | ||||
| { | ||||
|     int rc; | ||||
|     ithread_t cmdloop_thread; | ||||
| #ifndef WIN32 | ||||
|     int sig; | ||||
|     sigset_t sigs_to_catch; | ||||
| #endif | ||||
|     int code; | ||||
|  | ||||
|     rc = TvCtrlPointStart( linux_print, NULL ); | ||||
|     if( rc != TV_SUCCESS ) { | ||||
|         SampleUtil_Print( "Error starting UPnP TV Control Point" ); | ||||
|         return rc; | ||||
|         exit( rc ); | ||||
|     } | ||||
|     // start a command loop thread | ||||
|     code = | ||||
|         ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, | ||||
|                         NULL ); | ||||
|  | ||||
| #ifndef WIN32 | ||||
|     /* | ||||
|        Catch Ctrl-C and properly shutdown  | ||||
|      */ | ||||
| @@ -432,10 +462,6 @@ main( int argc, | ||||
|     sigwait( &sigs_to_catch, &sig ); | ||||
|  | ||||
|     SampleUtil_Print( "Shutting down on signal %d...", sig ); | ||||
| #else | ||||
| 	ithread_join(cmdloop_thread, NULL); | ||||
| #endif | ||||
|  | ||||
|     rc = TvCtrlPointStop(); | ||||
|     return rc; | ||||
|     rc = TvCtrlPointStop(  ); | ||||
|     exit( rc ); | ||||
| } | ||||
|   | ||||
| @@ -224,7 +224,7 @@ TvCtrlPointRefresh( void ) | ||||
| { | ||||
|     int rc; | ||||
|  | ||||
|     TvCtrlPointRemoveAll(); | ||||
|     TvCtrlPointRemoveAll(  ); | ||||
|  | ||||
|     /* | ||||
|        Search for all devices of type tvdevice version 1,  | ||||
| @@ -539,7 +539,7 @@ TvCtrlPointGetDevice( int devnum, | ||||
|  * | ||||
|  ********************************************************************************/ | ||||
| int | ||||
| TvCtrlPointPrintList() | ||||
| TvCtrlPointPrintList(  ) | ||||
| { | ||||
|     struct TvDeviceNode *tmpdevnode; | ||||
|     int i = 0; | ||||
| @@ -1096,7 +1096,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType, | ||||
|                 if( DescDoc ) | ||||
|                     ixmlDocument_free( DescDoc ); | ||||
|  | ||||
|                 TvCtrlPointPrintList(); | ||||
|                 TvCtrlPointPrintList(  ); | ||||
|                 break; | ||||
|             } | ||||
|  | ||||
| @@ -1122,7 +1122,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType, | ||||
|                 TvCtrlPointRemoveDevice( d_event->DeviceId ); | ||||
|  | ||||
|                 SampleUtil_Print( "After byebye:" ); | ||||
|                 TvCtrlPointPrintList(); | ||||
|                 TvCtrlPointPrintList(  ); | ||||
|  | ||||
|                 break; | ||||
|             } | ||||
| @@ -1354,7 +1354,7 @@ TvCtrlPointStart( print_string printFunctionPtr, | ||||
| { | ||||
|     ithread_t timer_thread; | ||||
|     int rc; | ||||
|     unsigned short port = 0; | ||||
|     short int port = 0; | ||||
|     char *ip_address = NULL; | ||||
|  | ||||
|     SampleUtil_Initialize( printFunctionPtr ); | ||||
| @@ -1362,42 +1362,34 @@ TvCtrlPointStart( print_string printFunctionPtr, | ||||
|  | ||||
|     ithread_mutex_init( &DeviceListMutex, 0 ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "Initializing UPnP Sdk with\n" | ||||
|         "\tipaddress = %s port = %u\n", | ||||
|     SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d", | ||||
|                       ip_address, port ); | ||||
|  | ||||
|     rc = UpnpInit( ip_address, port ); | ||||
|     if( UPNP_E_SUCCESS != rc ) { | ||||
|         SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return TV_ERROR; | ||||
|     } | ||||
|  | ||||
|     if( NULL == ip_address ) { | ||||
|         ip_address = UpnpGetServerIpAddress(); | ||||
|     } | ||||
|     if( 0 == port ) { | ||||
|         port = UpnpGetServerPort(); | ||||
|     } | ||||
|     if( NULL == ip_address ) | ||||
|         ip_address = UpnpGetServerIpAddress(  ); | ||||
|     if( 0 == port ) | ||||
|         port = UpnpGetServerPort(  ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "UPnP Initialized\n" | ||||
| 	"\tipaddress= %s port = %u\n", | ||||
|         ip_address, port ); | ||||
|     SampleUtil_Print( "UPnP Initialized (%s:%d)", ip_address, port ); | ||||
|  | ||||
|     SampleUtil_Print( "Registering Control Point" ); | ||||
|     rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler, | ||||
|                              &ctrlpt_handle, &ctrlpt_handle ); | ||||
|     if( UPNP_E_SUCCESS != rc ) { | ||||
|         SampleUtil_Print( "Error registering CP: %d", rc ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return TV_ERROR; | ||||
|     } | ||||
|  | ||||
|     SampleUtil_Print( "Control Point Registered" ); | ||||
|  | ||||
|     TvCtrlPointRefresh(); | ||||
|     TvCtrlPointRefresh(  ); | ||||
|  | ||||
|     // start a timer thread | ||||
|     ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL ); | ||||
| @@ -1408,10 +1400,10 @@ TvCtrlPointStart( print_string printFunctionPtr, | ||||
| int | ||||
| TvCtrlPointStop( void ) | ||||
| { | ||||
|     TvCtrlPointRemoveAll(); | ||||
|     TvCtrlPointRemoveAll(  ); | ||||
|     UpnpUnRegisterClient( ctrlpt_handle ); | ||||
|     UpnpFinish(); | ||||
|     SampleUtil_Finish(); | ||||
|     UpnpFinish(  ); | ||||
|     SampleUtil_Finish(  ); | ||||
|  | ||||
|     return TV_SUCCESS; | ||||
| } | ||||
|   | ||||
| @@ -39,9 +39,7 @@ extern "C" { | ||||
| #include <stdio.h> | ||||
|  | ||||
| #include "ithread.h" | ||||
| #ifndef WIN32 | ||||
| #include <unistd.h> | ||||
| #endif | ||||
| #include <stdarg.h> | ||||
| #include <stdlib.h> | ||||
| #include <signal.h> | ||||
|   | ||||
| @@ -29,14 +29,10 @@ | ||||
| // | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
|  | ||||
| #include <stdio.h> | ||||
| #include "sample_util.h" | ||||
| #include "upnp_tv_device.h" | ||||
|  | ||||
|  | ||||
| #include <stdio.h> | ||||
|  | ||||
|  | ||||
| /****************************************************************************** | ||||
|  * linux_print | ||||
|  * | ||||
| @@ -86,7 +82,7 @@ TvDeviceCommandLoop( void *args ) | ||||
|  | ||||
|         if( strcasecmp( cmd, "exit" ) == 0 ) { | ||||
|             SampleUtil_Print( "Shutting down...\n" ); | ||||
|             TvDeviceStop(); | ||||
|             TvDeviceStop(  ); | ||||
|             exit( 0 ); | ||||
|         } else { | ||||
|             SampleUtil_Print( "\n   Unknown command: %s\n\n", cmd ); | ||||
| @@ -121,26 +117,26 @@ TvDeviceCommandLoop( void *args ) | ||||
|  *                  | ||||
|  * | ||||
|  *****************************************************************************/ | ||||
| int main( IN int argc, IN char **argv ) | ||||
| int | ||||
| main( IN int argc, | ||||
|       IN char **argv ) | ||||
| { | ||||
|  | ||||
|     unsigned int portTemp = 0; | ||||
|     char *ip_address = NULL, | ||||
|      *desc_doc_name = NULL, | ||||
|      *web_dir_path = NULL; | ||||
|     int rc; | ||||
|     ithread_t cmdloop_thread; | ||||
| #ifndef WIN32 | ||||
|     int sig; | ||||
|     sigset_t sigs_to_catch; | ||||
| #endif | ||||
|     int code; | ||||
|     unsigned int port = 0; | ||||
|     int sig; | ||||
|     sigset_t sigs_to_catch; | ||||
|  | ||||
|     int i = 0; | ||||
|  | ||||
|     SampleUtil_Initialize( linux_print ); | ||||
|  | ||||
|     // Parse options | ||||
|     //Parse options | ||||
|     for( i = 1; i < argc; i++ ) { | ||||
|         if( strcmp( argv[i], "-ip" ) == 0 ) { | ||||
|             ip_address = argv[++i]; | ||||
| @@ -167,18 +163,21 @@ int main( IN int argc, IN char **argv ) | ||||
|                 ( "\tweb_dir_path: Filesystem path where web files " | ||||
|                   "related to the device are stored\n" ); | ||||
|             SampleUtil_Print( "\t\te.g.: /upnp/sample/tvdevice/web\n" ); | ||||
|             return 1; | ||||
|             exit( 1 ); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     port = ( unsigned short )portTemp; | ||||
|  | ||||
|     TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print ); | ||||
|     TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, | ||||
|                    linux_print ); | ||||
|  | ||||
|     /* start a command loop thread */ | ||||
|     code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop, NULL ); | ||||
|     /* | ||||
|        start a command loop thread  | ||||
|      */ | ||||
|     code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop, | ||||
|                            NULL ); | ||||
|  | ||||
| #ifndef WIN32 | ||||
|     /* | ||||
|        Catch Ctrl-C and properly shutdown  | ||||
|      */ | ||||
| @@ -187,11 +186,6 @@ int main( IN int argc, IN char **argv ) | ||||
|     sigwait( &sigs_to_catch, &sig ); | ||||
|  | ||||
|     SampleUtil_Print( "Shutting down on signal %d...\n", sig ); | ||||
| #else | ||||
| 	ithread_join(cmdloop_thread, NULL); | ||||
| #endif | ||||
|     rc = TvDeviceStop(); | ||||
|      | ||||
|     return rc; | ||||
|     TvDeviceStop(  ); | ||||
|     exit( 0 ); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1915,11 +1915,11 @@ TvDeviceCallbackEventHandler( Upnp_EventType EventType, | ||||
|  * | ||||
|  *****************************************************************************/ | ||||
| int | ||||
| TvDeviceStop() | ||||
| TvDeviceStop(  ) | ||||
| { | ||||
|     UpnpUnRegisterRootDevice( device_handle ); | ||||
|     UpnpFinish(); | ||||
|     SampleUtil_Finish(); | ||||
|     UpnpFinish(  ); | ||||
|     SampleUtil_Finish(  ); | ||||
|     ithread_mutex_destroy( &TVDevMutex ); | ||||
|     return UPNP_E_SUCCESS; | ||||
| } | ||||
| @@ -1960,35 +1960,30 @@ TvDeviceStart( char *ip_address, | ||||
|  | ||||
|     SampleUtil_Initialize( pfun ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "Initializing UPnP Sdk with\n" | ||||
|         "\tipaddress = %s port = %u\n", | ||||
|     SampleUtil_Print | ||||
|         ( "Initializing UPnP Sdk with \n \t ipaddress = %s port = %d\n", | ||||
|           ip_address, port ); | ||||
|  | ||||
|     if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) { | ||||
|         SampleUtil_Print( "Error with UpnpInit -- %d\n", ret ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     if( ip_address == NULL ) { | ||||
|         ip_address = UpnpGetServerIpAddress(); | ||||
|         ip_address = UpnpGetServerIpAddress(  ); | ||||
|     } | ||||
|  | ||||
|     port = UpnpGetServerPort(); | ||||
|         port = UpnpGetServerPort(  ); | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "UPnP Initialized\n" | ||||
| 	"\tipaddress= %s port = %u\n", | ||||
|     SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n", | ||||
|                       ip_address, port ); | ||||
|  | ||||
|     if( desc_doc_name == NULL ) { | ||||
|     if( desc_doc_name == NULL ) | ||||
|         desc_doc_name = "tvdevicedesc.xml"; | ||||
|     } | ||||
|  | ||||
|     if( web_dir_path == NULL ) { | ||||
|     if( web_dir_path == NULL ) | ||||
|         web_dir_path = DEFAULT_WEB_DIR; | ||||
|     } | ||||
|  | ||||
|     snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address, | ||||
|               port, desc_doc_name ); | ||||
| @@ -2000,13 +1995,12 @@ TvDeviceStart( char *ip_address, | ||||
|         SampleUtil_Print | ||||
|             ( "Error specifying webserver root directory -- %s: %d\n", | ||||
|               web_dir_path, ret ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     SampleUtil_Print( | ||||
|         "Registering the RootDevice\n" | ||||
|         "\t with desc_doc_url: %s\n", | ||||
|     SampleUtil_Print | ||||
|         ( "Registering the RootDevice\n\t with desc_doc_url: %s\n", | ||||
|           desc_doc_url ); | ||||
|  | ||||
|     if( ( ret = UpnpRegisterRootDevice( desc_doc_url, | ||||
| @@ -2014,25 +2008,24 @@ TvDeviceStart( char *ip_address, | ||||
|                                         &device_handle, &device_handle ) ) | ||||
|         != UPNP_E_SUCCESS ) { | ||||
|         SampleUtil_Print( "Error registering the rootdevice : %d\n", ret ); | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return ret; | ||||
|     } else { | ||||
|         SampleUtil_Print( | ||||
|             "RootDevice Registered\n" | ||||
|             "Initializing State Table\n"); | ||||
|         SampleUtil_Print( "RootDevice Registered\n" ); | ||||
|  | ||||
|         SampleUtil_Print( "Initializing State Table\n" ); | ||||
|         TvDeviceStateTableInit( desc_doc_url ); | ||||
|         SampleUtil_Print("State Table Initialized\n"); | ||||
|         SampleUtil_Print( "State Table Initialized\n" ); | ||||
|  | ||||
|         if( ( ret = | ||||
|               UpnpSendAdvertisement( device_handle, default_advr_expire ) ) | ||||
|             != UPNP_E_SUCCESS ) { | ||||
|             SampleUtil_Print( "Error sending advertisements : %d\n", ret ); | ||||
|             UpnpFinish(); | ||||
|             UpnpFinish(  ); | ||||
|             return ret; | ||||
|         } | ||||
|  | ||||
|         SampleUtil_Print("Advertisements Sent\n"); | ||||
|         SampleUtil_Print( "Advertisements Sent\n" ); | ||||
|     } | ||||
|     return UPNP_E_SUCCESS; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -41,9 +41,7 @@ extern "C" { | ||||
|  | ||||
| #include "ithread.h" | ||||
| #include <stdlib.h> | ||||
| #ifndef WIN32 | ||||
| #include <unistd.h> | ||||
| #endif | ||||
| #include <string.h> | ||||
| #include "upnp.h" | ||||
| #include "sample_util.h" | ||||
|   | ||||
| @@ -31,76 +31,71 @@ | ||||
|  | ||||
|  | ||||
| #include "config.h" | ||||
|  | ||||
|  | ||||
| #include <sys/stat.h> | ||||
|  | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <signal.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
|  | ||||
|  | ||||
| #include <sys/stat.h> | ||||
| #ifndef WIN32 | ||||
| 	#include <arpa/inet.h> | ||||
| 	#include <net/if.h> | ||||
| 	#include <netinet/in.h> | ||||
| 	#include <sys/ioctl.h> | ||||
| 	#include <sys/param.h> | ||||
| 	#include <sys/socket.h> | ||||
| 	#include <sys/types.h> | ||||
| 	#include <sys/socket.h> | ||||
| 	#include <netinet/in.h> | ||||
| 	#include <arpa/inet.h> | ||||
|  | ||||
| 	#ifndef SPARC_SOLARIS | ||||
| //		#include <linux/if.h> | ||||
| 		#include <net/if.h> | ||||
| 	#else | ||||
| 		#include <fcntl.h> | ||||
| 		#include <net/if.h> | ||||
| 		#include <sys/sockio.h> | ||||
| 	#endif | ||||
|  | ||||
| 	#include <sys/ioctl.h> | ||||
| 	#include <sys/utsname.h> | ||||
|  | ||||
|  | ||||
| 	#include <unistd.h> | ||||
|  | ||||
|  | ||||
| 	#if defined(_sun) | ||||
| 		#include <sys/sockio.h> | ||||
| 		#include <fcntl.h> | ||||
| 	#elif defined(BSD) && BSD >= 199306 | ||||
| 	#include <sys/param.h> | ||||
| 	#if (defined(BSD) && BSD >= 199306) | ||||
| 		#include <ifaddrs.h> | ||||
| 	#endif | ||||
| #endif /* WIN32 */ | ||||
|  | ||||
|  | ||||
| #endif | ||||
| #include "upnpapi.h" | ||||
| #include "httpreadwrite.h" | ||||
| #include "membuffer.h" | ||||
| #include "ssdplib.h" | ||||
| #include "soaplib.h" | ||||
| #include "ThreadPool.h" | ||||
| #include "membuffer.h" | ||||
|  | ||||
| #include "httpreadwrite.h" | ||||
|  | ||||
| // Needed for GENA | ||||
| #include "gena.h" | ||||
| #include "miniserver.h" | ||||
| #include "service_table.h" | ||||
|  | ||||
| #include "miniserver.h" | ||||
|  | ||||
| #ifdef INTERNAL_WEB_SERVER | ||||
| 	#include "webserver.h" | ||||
| 	#include "urlconfig.h" | ||||
| #endif // INTERNAL_WEB_SERVER | ||||
|  | ||||
|  | ||||
| // | ||||
| virtualDirList *pVirtualDirList; | ||||
|  | ||||
| // Mutex to synchronize the subscription handling at the client side | ||||
| CLIENTONLY( ithread_mutex_t GlobalClientSubscribeMutex; ) | ||||
|  | ||||
| // rwlock to synchronize handles (root device or control point handle) | ||||
|     ithread_rwlock_t GlobalHndRWLock; | ||||
| //Mutex to synchronize handles ( root device or control point handle) | ||||
|     ithread_mutex_t GlobalHndMutex; | ||||
|  | ||||
| // Mutex to synchronize the uuid creation process | ||||
|     ithread_mutex_t gUUIDMutex; | ||||
|  | ||||
|     TimerThread gTimerThread; | ||||
|  | ||||
|     ThreadPool gSendThreadPool; | ||||
|     ThreadPool gRecvThreadPool; | ||||
|  | ||||
|     ThreadPool gSendThreadPool; | ||||
|  | ||||
|      ThreadPool gMiniServerThreadPool; | ||||
|  | ||||
| //Flag to indicate the state of web server | ||||
| @@ -213,31 +208,31 @@ int UpnpInit( IN const char *HostIP, | ||||
|              return UPNP_E_INIT_FAILED; | ||||
|     } | ||||
|  | ||||
|     UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit\n" ); | ||||
|     UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit \n" ); | ||||
|     // initialize mutex | ||||
| #ifdef __CYGWIN__ | ||||
|         /* On Cygwin, pthread_mutex_init() fails without this memset. */ | ||||
|         /* TODO: Fix Cygwin so we don't need this memset(). */ | ||||
|         memset(&GlobalHndRWLock, 0, sizeof(GlobalHndRWLock)); | ||||
|         memset(&GlobalHndMutex, 0, sizeof(GlobalHndMutex)); | ||||
| #endif | ||||
|     if (ithread_rwlock_init(&GlobalHndRWLock, NULL) != 0) { | ||||
|         if( ithread_mutex_init( &GlobalHndMutex, 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 ) { | ||||
|     if( HostIP != NULL ) | ||||
|         strcpy( LOCAL_HOST, HostIP ); | ||||
|     } else { | ||||
|     else { | ||||
|         if( getlocalhostname( LOCAL_HOST ) != UPNP_E_SUCCESS ) { | ||||
|             HandleUnlock(); | ||||
|             return UPNP_E_INIT_FAILED; | ||||
| @@ -273,7 +268,7 @@ int UpnpInit( IN const char *HostIP, | ||||
|  | ||||
|     if( ThreadPoolInit( &gMiniServerThreadPool, &attr ) != UPNP_E_SUCCESS ) { | ||||
|         UpnpSdkInit = 0; | ||||
|         UpnpFinish(); | ||||
|         UpnpFinish(  ); | ||||
|         return UPNP_E_INIT_FAILED; | ||||
|     } | ||||
|  | ||||
| @@ -320,7 +315,7 @@ int UpnpInit( IN const char *HostIP, | ||||
|         "Host Ip: %s Host Port: %d\n", LOCAL_HOST, | ||||
|         LOCAL_PORT ); | ||||
|  | ||||
|     UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Exiting UpnpInit\n" ); | ||||
|     UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Exiting UpnpInit \n" ); | ||||
|  | ||||
|     return UPNP_E_SUCCESS; | ||||
|  | ||||
| @@ -328,54 +323,27 @@ int UpnpInit( IN const char *HostIP, | ||||
|  | ||||
| #ifdef DEBUG | ||||
| static void  | ||||
| PrintThreadPoolStats( | ||||
| 	ThreadPool *tp,  | ||||
| 	const char *DbgFileName, | ||||
| 	int DbgLineNo, | ||||
| 	const char *msg) | ||||
| PrintThreadPoolStats (const char* DbgFileName, int DbgLineNo, | ||||
| 		      const char* msg, const ThreadPoolStats* const stats) | ||||
| { | ||||
| 	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", | ||||
| 	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.avgWaitHQ, | ||||
| 		stats.avgWaitMQ, | ||||
| 		stats.avgWaitLQ, | ||||
| 		stats.maxThreads, | ||||
| 		stats.workerThreads, | ||||
| 		stats.persistentThreads, | ||||
| 		stats.idleThreads, | ||||
| 		stats.totalThreads, | ||||
| 		stats.totalWorkTime, | ||||
| 		stats.totalIdleTime); | ||||
| 		    stats->currentJobsHQ, stats->currentJobsMQ, | ||||
| 		    stats->currentJobsLQ, stats->workerThreads, | ||||
| 		    stats->idleThreads, stats->persistentThreads, | ||||
| 		    stats->avgWaitHQ, stats->avgWaitMQ, stats->avgWaitLQ, | ||||
| 		    stats->maxThreads, stats->totalWorkTime, | ||||
| 		    stats->totalIdleTime ); | ||||
| } | ||||
| #else /* DEBUG */ | ||||
| static UPNP_INLINE void  | ||||
| PrintThreadPoolStats( | ||||
| 	ThreadPool *tp,  | ||||
| 	const char *DbgFileName, | ||||
| 	int DbgLineNo, | ||||
| 	const char *msg) | ||||
| { | ||||
| } | ||||
| #endif /* DEBUG */ | ||||
| #endif | ||||
|  | ||||
|       | ||||
| /**************************************************************************** | ||||
| @@ -406,8 +374,12 @@ UpnpFinish() | ||||
| #endif | ||||
|     struct Handle_Info *temp; | ||||
|  | ||||
| #ifdef DEBUG | ||||
|     ThreadPoolStats stats; | ||||
| #endif | ||||
|  | ||||
| #ifdef WIN32 | ||||
| //	WSACleanup(); | ||||
| //	WSACleanup( ); | ||||
| #endif | ||||
|  | ||||
|     if( UpnpSdkInit != 1 ) { | ||||
| @@ -415,15 +387,20 @@ UpnpFinish() | ||||
|     } | ||||
|  | ||||
|     UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpFinish : UpnpSdkInit is :%d:\n", UpnpSdkInit ); | ||||
|         "Inside UpnpFinish : UpnpSdkInit is :%d:\n", | ||||
|         UpnpSdkInit ); | ||||
| #ifdef DEBUG | ||||
|     if( UpnpSdkInit == 1 ) { | ||||
|         UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, | ||||
|             "UpnpFinish : UpnpSdkInit is ONE\n" ); | ||||
|     } | ||||
|     PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool"); | ||||
|     PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool"); | ||||
|     PrintThreadPoolStats(&gMiniServerThreadPool, __FILE__, __LINE__, "MiniServer Thread Pool"); | ||||
|  | ||||
|     ThreadPoolGetStats( &gRecvThreadPool, &stats ); | ||||
|     PrintThreadPoolStats (__FILE__, __LINE__, | ||||
| 	"Recv Thread Pool", &stats); | ||||
|     ThreadPoolGetStats( &gSendThreadPool, &stats ); | ||||
|     PrintThreadPoolStats (__FILE__, __LINE__, | ||||
| 	"Send Thread Pool", &stats); | ||||
| #endif | ||||
| #ifdef INCLUDE_DEVICE_APIS | ||||
|     if( GetDeviceHandleInfo( &device_handle, &temp ) == HND_DEVICE ) | ||||
|         UpnpUnRegisterRootDevice( device_handle ); | ||||
| @@ -435,47 +412,51 @@ UpnpFinish() | ||||
| #endif | ||||
|  | ||||
|     TimerThreadShutdown( &gTimerThread ); | ||||
|  | ||||
|     StopMiniServer(); | ||||
|  | ||||
| #if EXCLUDE_WEB_SERVER == 0 | ||||
|     web_server_destroy(); | ||||
| #endif | ||||
|  | ||||
|     ThreadPoolShutdown(&gMiniServerThreadPool); | ||||
|     ThreadPoolShutdown(&gRecvThreadPool); | ||||
|     ThreadPoolShutdown(&gSendThreadPool); | ||||
|  | ||||
|     PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool"); | ||||
|     PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool"); | ||||
|     PrintThreadPoolStats(&gMiniServerThreadPool, __FILE__, __LINE__, "MiniServer Thread Pool"); | ||||
| #ifdef DEBUG | ||||
|     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); | ||||
|     UpnpCloseLog(); | ||||
| #endif | ||||
|  | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|     ithread_mutex_destroy(&GlobalClientSubscribeMutex); | ||||
|     ithread_mutex_destroy( &GlobalClientSubscribeMutex ); | ||||
| #endif | ||||
|     ithread_rwlock_destroy(&GlobalHndRWLock); | ||||
|     ithread_mutex_destroy(&gUUIDMutex); | ||||
|     ithread_mutex_destroy( &GlobalHndMutex ); | ||||
|     ithread_mutex_destroy( &gUUIDMutex ); | ||||
|  | ||||
|     // remove all virtual dirs | ||||
|     UpnpRemoveAllVirtualDirs(); | ||||
|  | ||||
|     // allow static linking | ||||
|     // leuk_he allow static linking: | ||||
| #ifdef WIN32 | ||||
| #ifdef PTW32_STATIC_LIB | ||||
|     pthread_win32_thread_detach_np(); | ||||
|     pthread_win32_thread_detach_np (); | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
|  | ||||
|     UpnpSdkInit = 0; | ||||
|     UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, | ||||
|         "Exiting UpnpFinish : UpnpSdkInit is :%d:\n", UpnpSdkInit); | ||||
|     UpnpCloseLog(); | ||||
|  | ||||
|     return UPNP_E_SUCCESS; | ||||
|  | ||||
| } | ||||
| /*************************** End of  UpnpFinish  *****************************/ | ||||
| }  /********************* End of  UpnpFinish  *************************/ | ||||
|  | ||||
| /****************************************************************************** | ||||
| /**************************************************************************** | ||||
|  * Function: UpnpGetServerPort | ||||
|  * | ||||
|  * Parameters: NONE | ||||
| @@ -972,7 +953,7 @@ GetDescDocumentAndURL( IN Upnp_DescType descriptionType, | ||||
|     char *temp_str = NULL; | ||||
|     FILE *fp = NULL; | ||||
|     off_t fileLen; | ||||
|     size_t num_read; | ||||
|     unsigned num_read; | ||||
|     time_t last_modified; | ||||
|     struct stat file_info; | ||||
|     struct sockaddr_in serverAddr; | ||||
| @@ -1578,7 +1559,7 @@ UpnpSearchAsync( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpSearchAsync \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -1754,7 +1735,7 @@ UpnpSubscribeAsync( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpSubscribeAsync \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -1771,13 +1752,15 @@ 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; | ||||
| @@ -1837,7 +1820,7 @@ UpnpSubscribe( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpSubscribe \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -1897,7 +1880,7 @@ UpnpUnSubscribe( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpUnSubscribe \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -1956,7 +1939,7 @@ UpnpUnSubscribeAsync( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpUnSubscribeAsync \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2030,7 +2013,7 @@ UpnpRenewSubscription( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpRenewSubscription \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2095,7 +2078,7 @@ UpnpRenewSubscriptionAsync( IN UpnpClient_Handle Hnd, | ||||
|  | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpRenewSubscriptionAsync \n" ); | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2190,7 +2173,7 @@ UpnpNotify( IN UpnpDevice_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpNotify \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2261,7 +2244,7 @@ UpnpNotifyExt( IN UpnpDevice_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpNotify \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2338,7 +2321,7 @@ UpnpAcceptSubscription( IN UpnpDevice_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpAcceptSubscription \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2414,7 +2397,7 @@ UpnpAcceptSubscriptionExt( IN UpnpDevice_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpAcceptSubscription \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_DEVICE ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2510,7 +2493,7 @@ UpnpSendAction( IN UpnpClient_Handle Hnd, | ||||
|     } | ||||
|     DevUDN_const = NULL; | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2594,7 +2577,7 @@ UpnpSendActionEx( IN UpnpClient_Handle Hnd, | ||||
|         return retVal; | ||||
|     } | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2670,7 +2653,7 @@ UpnpSendActionAsync( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpSendActionAsync \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2790,7 +2773,7 @@ UpnpSendActionExAsync( IN UpnpClient_Handle Hnd, | ||||
|         return retVal; | ||||
|     } | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2904,7 +2887,7 @@ UpnpGetServiceVarStatusAsync( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpGetServiceVarStatusAsync \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -2984,7 +2967,7 @@ UpnpGetServiceVarStatus( IN UpnpClient_Handle Hnd, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Inside UpnpGetServiceVarStatus \n" ); | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     if( GetHandleInfo( Hnd, &SInfo ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
|         return UPNP_E_INVALID_HANDLE; | ||||
| @@ -3317,9 +3300,9 @@ UpnpDownloadXmlDoc( const char *url, | ||||
|         UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|             "****************** END OF Parsed XML Doc *****************\n" ); | ||||
|         ixmlFreeDOMString( xml_buf ); | ||||
| #endif | ||||
|         UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|             "Exiting UpnpDownloadXmlDoc\n" ); | ||||
| #endif | ||||
|         return UPNP_E_SUCCESS; | ||||
|     } | ||||
| } | ||||
| @@ -3652,6 +3635,7 @@ 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__, | ||||
| @@ -3660,6 +3644,7 @@ 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; | ||||
|   | ||||
| @@ -310,30 +310,17 @@ void UpnpDisplayFileAndLine( | ||||
| 	IN const char *DbgFileName, | ||||
| 	IN int DbgLineNo) | ||||
| { | ||||
| #define NLINES 2 | ||||
| #define MAX_LINE_SIZE 512 | ||||
| #define NUMBER_OF_STARS 80 | ||||
| 	const char *lines[NLINES]; | ||||
| 	char buf[NLINES][MAX_LINE_SIZE]; | ||||
| 	int i; | ||||
|  | ||||
| 	/* Initialize the pointer array */ | ||||
| 	for (i = 0; i < NLINES; i++) { | ||||
| 		lines[i] = buf[i]; | ||||
| 	} | ||||
|  | ||||
| 	/* Put the debug lines in the buffer */ | ||||
| 	sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX", | ||||
| 		(unsigned long int)ithread_self()); | ||||
| 	int starlength = 66; | ||||
| 	const char *lines[2]; | ||||
| 	char FileAndLine[500]; | ||||
| 	lines[0] = "DEBUG"; | ||||
| 	if (DbgFileName) { | ||||
| 		sprintf(buf[1], | ||||
| 		sprintf(FileAndLine, | ||||
| 			"FILE: %s, LINE: %d", | ||||
| 			DbgFileName, | ||||
| 			DbgLineNo); | ||||
| 			DbgFileName, DbgLineNo); | ||||
| 		lines[1] = FileAndLine; | ||||
| 	} | ||||
|  | ||||
| 	/* Show the lines centered */ | ||||
| 	UpnpDisplayBanner(fd, lines, NLINES, NUMBER_OF_STARS); | ||||
| 	UpnpDisplayBanner(fd, lines, 2, starlength); | ||||
| 	fflush(fd); | ||||
| } | ||||
| #endif | ||||
|   | ||||
| @@ -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 { | ||||
|  | ||||
| }; | ||||
|  | ||||
| // Initializing the array of error structures.  | ||||
| //Intializing 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"}, | ||||
| @@ -581,5 +581,4 @@ UpnpCreatePropertySet( IN int NumArg, | ||||
|     return PropSet; | ||||
| } | ||||
|  | ||||
| #endif // EXCLUDE_DOM == 0 | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -93,7 +93,7 @@ GenaAutoRenewSubscription( IN void *input ) | ||||
|         } | ||||
|     } | ||||
|     if( send_callback ) { | ||||
|         HandleReadLock(); | ||||
|         HandleLock(); | ||||
|         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,4 +881,3 @@ gena_process_notification_event( IN SOCKINFO * info, | ||||
|  | ||||
| #endif // INCLUDE_CLIENT_APIS | ||||
| #endif // EXCLUDE_GENA | ||||
|  | ||||
|   | ||||
| @@ -365,7 +365,7 @@ genaNotifyThread( IN void *input ) | ||||
|     struct Handle_Info *handle_info; | ||||
|     ThreadPoolJob job; | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     //validate context | ||||
|  | ||||
|     if( GetHandleInfo( in->device_handle, &handle_info ) != HND_DEVICE ) { | ||||
|   | ||||
| @@ -35,7 +35,6 @@ | ||||
| ************************************************************************/ | ||||
|  | ||||
| #include "config.h" | ||||
|  | ||||
| #ifndef WIN32 | ||||
|  #include <arpa/inet.h> | ||||
|  #include <netinet/in.h> | ||||
| @@ -43,13 +42,12 @@ | ||||
|  #include <sys/wait.h> | ||||
|  #include <unistd.h> | ||||
|  #include <sys/time.h> | ||||
| #else /* WIN32 */ | ||||
| #else | ||||
|  #include <winsock2.h> | ||||
|  | ||||
|  typedef int socklen_t; | ||||
|  #define EAFNOSUPPORT 97 | ||||
| #endif /* WIN32 */ | ||||
|  | ||||
| #endif | ||||
| #include "unixutil.h" | ||||
| #include "ithread.h" | ||||
|  | ||||
| @@ -67,6 +65,7 @@ | ||||
| #include "ThreadPool.h" | ||||
| #include "httpreadwrite.h" | ||||
| #include "statcodes.h" | ||||
| #include "upnp.h" | ||||
| #include "upnpapi.h" | ||||
|  | ||||
| #define APPLICATION_LISTENING_PORT 49152 | ||||
| @@ -89,16 +88,17 @@ static MiniServerCallback gGenaCallback = NULL; | ||||
| static MiniServerState gMServState = MSERV_IDLE; | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: SetHTTPGetCallback | ||||
|  * | ||||
|  * Parameters : | ||||
|  * 	MiniServerCallback callback - HTTP Callback to be invoked  | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Set HTTP Get Callback | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	SetHTTPGetCallback | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerCallback callback ; - HTTP Callback to be invoked  | ||||
| * | ||||
| *	Description :	Set HTTP Get Callback | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void | ||||
| SetHTTPGetCallback( MiniServerCallback callback ) | ||||
| { | ||||
| @@ -106,35 +106,35 @@ SetHTTPGetCallback( MiniServerCallback callback ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: SetSoapCallback | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerCallback callback - SOAP Callback to be invoked  | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Set SOAP Callback | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| #ifdef INCLUDE_DEVICE_APIS | ||||
| * Function :	SetSoapCallback | ||||
| * | ||||
| * Parameters : | ||||
| *	MiniServerCallback callback ; - SOAP Callback to be invoked  | ||||
| * | ||||
| * Description :	Set SOAP Callback | ||||
| * | ||||
| * Return :	void | ||||
| * | ||||
| * Note : | ||||
| ************************************************************************/ | ||||
| void | ||||
| SetSoapCallback( MiniServerCallback callback ) | ||||
| { | ||||
|     gSoapCallback = callback; | ||||
| } | ||||
| #endif /* INCLUDE_DEVICE_APIS */ | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: SetGenaCallback | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerCallback callback - GENA Callback to be invoked | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Set GENA Callback | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	SetGenaCallback | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerCallback callback ; - GENA Callback to be invoked | ||||
| * | ||||
| *	Description :	Set GENA Callback | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void | ||||
| SetGenaCallback( MiniServerCallback callback ) | ||||
| { | ||||
| @@ -142,19 +142,21 @@ SetGenaCallback( MiniServerCallback callback ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function :	dispatch_request | ||||
|  * | ||||
|  * Parameters : | ||||
|  *	IN SOCKINFO *info	- Socket Information object. | ||||
|  *	http_parser_t* hparser	- HTTP parser object. | ||||
|  * | ||||
|  * Description : | ||||
|  *	Based on the type pf message, appropriate callback is issued | ||||
|  * | ||||
|  * Return: int | ||||
|  *	0 - On Success | ||||
|  *	HTTP_INTERNAL_SERVER_ERROR - Callback is NULL | ||||
|  ************************************************************************/ | ||||
| *	Function :	dispatch_request | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN SOCKINFO *info ;		 Socket Information object. | ||||
| *		http_parser_t* hparser ; HTTP parser object. | ||||
| * | ||||
| *	Description :	Based on the type pf message, appropriate callback  | ||||
| *		is issued | ||||
| * | ||||
| *	Return : int ; | ||||
| *		0 - On Success | ||||
| *		HTTP_INTERNAL_SERVER_ERROR - Callback is NULL | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static int | ||||
| dispatch_request( IN SOCKINFO * info, | ||||
|                   http_parser_t * hparser ) | ||||
| @@ -198,19 +200,21 @@ dispatch_request( IN SOCKINFO * info, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: handle_error | ||||
|  * | ||||
|  * Parameters: | ||||
|  * 	IN SOCKINFO *info	- Socket Inforamtion Object | ||||
|  * 	int http_error_code	- HTTP Error Code | ||||
|  * 	int major		- Major Version Number | ||||
|  * 	int minor		- Minor Version Number | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Send Error Message | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	handle_error | ||||
| * | ||||
| *	Parameters : | ||||
| *		 | ||||
| *		IN SOCKINFO *info ;		Socket Inforamtion Object | ||||
| *		int http_error_code ;	HTTP Error Code | ||||
| *		int major ;				Major Version Number | ||||
| *		int minor ;				Minor Version Number | ||||
| * | ||||
| *	Description :	Send Error Message | ||||
| * | ||||
| *	Return : void; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE void | ||||
| handle_error( IN SOCKINFO * info, | ||||
|               int http_error_code, | ||||
| @@ -221,17 +225,18 @@ handle_error( IN SOCKINFO * info, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: free_handle_request_arg | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	void *args ; Request Message to be freed | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Free memory assigned for handling request and unitialize socket | ||||
|  * 	functionality | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	free_handle_request_arg | ||||
| * | ||||
| *	Parameters : | ||||
| *		void *args ; Request Message to be freed | ||||
| * | ||||
| *	Description :	Free memory assigned for handling request and unitial- | ||||
| *	-ize socket functionality | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static void | ||||
| free_handle_request_arg( void *args ) | ||||
| { | ||||
| @@ -243,16 +248,17 @@ free_handle_request_arg( void *args ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: handle_request | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	void *args - Request Message to be handled | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Receive the request and dispatch it for handling | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	handle_request | ||||
| * | ||||
| *	Parameters : | ||||
| *		void *args ;	Request Message to be handled | ||||
| * | ||||
| *	Description :	Receive the request and dispatch it for handling | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static void | ||||
| handle_request( void *args ) | ||||
| { | ||||
| @@ -313,18 +319,20 @@ handle_request( void *args ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: schedule_request_job | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN int connfd - Socket Descriptor on which connection is accepted | ||||
|  *	IN struct sockaddr_in* clientAddr - Clients Address information | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Initilize the thread pool to handle a request. | ||||
|  *	Sets priority for the job and adds the job to the thread pool | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	schedule_request_job | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN int connfd ;	Socket Descriptor on which connection is accepted | ||||
| *		IN struct sockaddr_in* clientAddr ;	Clients Address information | ||||
| * | ||||
| *	Description :	Initilize the thread pool to handle a request. | ||||
| *		Sets priority for the job and adds the job to the thread pool | ||||
| * | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE void | ||||
| schedule_request_job( IN int connfd, | ||||
|                       IN struct sockaddr_in *clientAddr ) | ||||
| @@ -363,93 +371,102 @@ schedule_request_job( IN int connfd, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: RunMiniServer | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerSockArray *miniSock - Socket Array | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Function runs the miniserver. The MiniServer accepts a  | ||||
|  *	new request and schedules a thread to handle the new request. | ||||
|  *	Checks for socket state and invokes appropriate read and shutdown  | ||||
|  *	actions for the Miniserver and SSDP sockets  | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	RunMiniServer | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerSockArray *miniSock ;	Socket Array | ||||
| * | ||||
| *	Description :	Function runs the miniserver. The MiniServer accepts a  | ||||
| *		new request and schedules a thread to handle the new request. | ||||
| *		Checks for socket state and invokes appropriate read and shutdown  | ||||
| *		actions for the Miniserver and SSDP sockets  | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static void | ||||
| RunMiniServer( MiniServerSockArray *miniSock ) | ||||
| RunMiniServer( MiniServerSockArray * miniSock ) | ||||
| { | ||||
|     char errorBuffer[ERROR_BUFFER_LEN]; | ||||
|     struct sockaddr_in clientAddr; | ||||
|     socklen_t clientLen; | ||||
|     SOCKET connectHnd; | ||||
|     SOCKET miniServSock = miniSock->miniServerSock; | ||||
|     SOCKET miniServStopSock =  miniSock->miniServerStopSock; | ||||
|     SOCKET ssdpSock = miniSock->ssdpSock; | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|     SOCKET ssdpReqSock = miniSock->ssdpReqSock; | ||||
| #endif | ||||
|     SOCKET miniServSock, | ||||
|       connectHnd; | ||||
|     SOCKET miniServStopSock; | ||||
|     SOCKET ssdpSock; | ||||
|  | ||||
|     CLIENTONLY( SOCKET ssdpReqSock; | ||||
|          ) | ||||
|  | ||||
|     fd_set expSet; | ||||
|     fd_set rdSet; | ||||
|     unsigned int maxMiniSock; | ||||
|     int byteReceived; | ||||
|     char requestBuf[256]; | ||||
|     int ret = 0; | ||||
|  | ||||
|     maxMiniSock = max( miniServSock, miniServStopSock) ; | ||||
|     maxMiniSock = max( maxMiniSock, (SOCKET)(ssdpSock) ); | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|     maxMiniSock = max( maxMiniSock, (SOCKET)(ssdpReqSock) ); | ||||
| #endif | ||||
|     ++maxMiniSock; | ||||
|     miniServSock = miniSock->miniServerSock; | ||||
|     miniServStopSock = miniSock->miniServerStopSock; | ||||
|  | ||||
|     ssdpSock = miniSock->ssdpSock; | ||||
|  | ||||
|     CLIENTONLY( ssdpReqSock = miniSock->ssdpReqSock; | ||||
|          ); | ||||
|  | ||||
|     gMServState = MSERV_RUNNING; | ||||
|     maxMiniSock = max( miniServSock, miniServStopSock ); | ||||
|     maxMiniSock = max( maxMiniSock, ( SOCKET ) ( ssdpSock ) ); | ||||
|  | ||||
|     CLIENTONLY( maxMiniSock = | ||||
|                 max( maxMiniSock, ( SOCKET ) ( ssdpReqSock ) ) ); | ||||
|  | ||||
|     ++maxMiniSock; | ||||
|  | ||||
|     while( TRUE ) { | ||||
|         FD_ZERO( &rdSet ); | ||||
|         FD_ZERO( &expSet ); | ||||
|  | ||||
|         FD_SET( miniServStopSock, &expSet ); | ||||
|  | ||||
|         FD_SET( miniServSock, &rdSet ); | ||||
|         FD_SET( miniServStopSock, &rdSet ); | ||||
|         FD_SET( ssdpSock, &rdSet ); | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|         FD_SET( ssdpReqSock, &rdSet ); | ||||
| #endif | ||||
|         CLIENTONLY( FD_SET( ssdpReqSock, &rdSet ) ); | ||||
|  | ||||
|         ret = select( maxMiniSock, &rdSet, NULL, &expSet, NULL ); | ||||
|         if ( ret == -1 ) { | ||||
|             strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         if( select( maxMiniSock, &rdSet, NULL, &expSet, NULL ) == | ||||
|             UPNP_SOCKETERROR ) { | ||||
|             UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|                 "Error in select(): %s\n", errorBuffer ); | ||||
| 	    /* Avoid 100% CPU in case of repeated error in select() */ | ||||
| 	    isleep( 1 ); | ||||
|                 "Error in select call !!!\n" ); | ||||
|             continue; | ||||
|         } else { | ||||
|  | ||||
|             if( FD_ISSET( miniServSock, &rdSet ) ) { | ||||
|                 clientLen = sizeof( struct sockaddr_in ); | ||||
|                 connectHnd = accept( miniServSock, | ||||
|                     ( struct sockaddr * )&clientAddr, &clientLen ); | ||||
|                 if( connectHnd == -1 ) { | ||||
|                     strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|                                      ( struct sockaddr * )&clientAddr, | ||||
|                                      &clientLen ); | ||||
|                 if( connectHnd == UPNP_INVALID_SOCKET ) { | ||||
|                     UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, | ||||
|                         "miniserver: Error in accept(): %s\n", errorBuffer ); | ||||
|                         "miniserver: Error" | ||||
|                         " in accepting connection\n" ); | ||||
|                     continue; | ||||
|                 } | ||||
|                 schedule_request_job( connectHnd, &clientAddr ); | ||||
|             } | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|             // ssdp | ||||
|             if( FD_ISSET( ssdpReqSock, &rdSet ) ) { | ||||
|                 readFromSSDPSocket( ssdpReqSock ); | ||||
|             } | ||||
| #endif | ||||
|             //ssdp | ||||
|             CLIENTONLY( if( FD_ISSET( ssdpReqSock, &rdSet ) ) { | ||||
|  | ||||
|                         readFromSSDPSocket( ssdpReqSock );} | ||||
|              ) | ||||
|  | ||||
|                 if( FD_ISSET( ssdpSock, &rdSet ) ) { | ||||
|                     readFromSSDPSocket( ssdpSock ); | ||||
|                 } | ||||
|  | ||||
|             if( FD_ISSET( miniServStopSock, &rdSet ) ) { | ||||
|  | ||||
|                 clientLen = sizeof( struct sockaddr_in ); | ||||
|                 memset( (char *)&clientAddr, 0, sizeof (struct sockaddr_in) ); | ||||
|                 memset( ( char * )&clientAddr, 0, | ||||
|                         sizeof( struct sockaddr_in ) ); | ||||
|                 byteReceived = | ||||
|                     recvfrom( miniServStopSock, requestBuf, 25, 0, | ||||
|                               ( struct sockaddr * )&clientAddr, | ||||
| @@ -457,11 +474,12 @@ RunMiniServer( MiniServerSockArray *miniSock ) | ||||
|                 if( byteReceived > 0 ) { | ||||
|                     requestBuf[byteReceived] = '\0'; | ||||
|                     UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, | ||||
|                         "Received response: %s From host %s \n", | ||||
|                         "Received response !!!  %s From host %s \n", | ||||
|                         requestBuf, inet_ntoa( clientAddr.sin_addr ) ); | ||||
|                     UpnpPrintf( UPNP_PACKET, MSERV, __FILE__, __LINE__, | ||||
|                         "Received multicast packet: \n %s\n", | ||||
|                         requestBuf ); | ||||
|  | ||||
|                     if( NULL != strstr( requestBuf, "ShutDown" ) ) { | ||||
|                         break; | ||||
| 		    } | ||||
| @@ -476,30 +494,31 @@ RunMiniServer( MiniServerSockArray *miniSock ) | ||||
|     UpnpCloseSocket( miniServStopSock ); | ||||
|     shutdown( ssdpSock, SD_BOTH ); | ||||
|     UpnpCloseSocket( ssdpSock ); | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|     shutdown( ssdpReqSock, SD_BOTH ); | ||||
|     UpnpCloseSocket( ssdpReqSock ); | ||||
| #endif | ||||
|     CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) ); | ||||
|     CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) ); | ||||
|  | ||||
|     free( miniSock ); | ||||
|  | ||||
|     gMServState = MSERV_IDLE; | ||||
|  | ||||
|     return; | ||||
|  | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: get_port | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	int sockfd - Socket Descriptor  | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Returns port to which socket, sockfd, is bound. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	-1 on error; check errno | ||||
|  *	 > 0 means port number | ||||
|  ************************************************************************/ | ||||
| *	Function :	get_port | ||||
| * | ||||
| *	Parameters : | ||||
| *		int sockfd ; Socket Descriptor  | ||||
| * | ||||
| *	Description :	Returns port to which socket, sockfd, is bound. | ||||
| * | ||||
| *	Return :	int,  | ||||
| *		-1 on error; check errno | ||||
| *		 > 0 means port number | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| static int | ||||
| get_port( int sockfd ) | ||||
| { | ||||
| @@ -522,33 +541,32 @@ get_port( int sockfd ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: get_miniserver_sockets | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerSockArray *out   - Socket Array | ||||
|  *	unsigned short listen_port - port on which the server is | ||||
|  *		listening for incoming connections	 | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Creates a STREAM socket, binds to INADDR_ANY and listens for | ||||
|  * 	incoming connecttions. Returns the actual port which the sockets | ||||
|  * 	sub-system returned.  | ||||
|  * | ||||
|  *	Also creates a DGRAM socket, binds to the loop back address and  | ||||
|  *	returns the port allocated by the socket sub-system. | ||||
|  * | ||||
|  * Return: int  | ||||
|  *	UPNP_E_OUTOF_SOCKET - Failed to create a socket | ||||
|  *	UPNP_E_SOCKET_BIND - Bind() failed | ||||
|  *	UPNP_E_LISTEN	- Listen() failed	 | ||||
|  *	UPNP_E_INTERNAL_ERROR - Port returned by the socket layer is < 0 | ||||
|  *	UPNP_E_SUCCESS	- Success | ||||
|  ************************************************************************/ | ||||
| *	Function :	get_miniserver_sockets | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerSockArray *out ;	Socket Array | ||||
| *		unsigned short listen_port ; port on which the server is listening  | ||||
| *									for incoming connections	 | ||||
| * | ||||
| *	Description :	Creates a STREAM socket, binds to INADDR_ANY and  | ||||
| *		listens for incoming connecttions. Returns the actual port which  | ||||
| *		the sockets sub-system returned.  | ||||
| *		Also creates a DGRAM socket, binds to the loop back address and  | ||||
| *		returns the port allocated by the socket sub-system. | ||||
| * | ||||
| *	Return :	int :  | ||||
| *		UPNP_E_OUTOF_SOCKET - Failed to create a socket | ||||
| *		UPNP_E_SOCKET_BIND - Bind() failed | ||||
| *		UPNP_E_LISTEN	- Listen() failed	 | ||||
| *		UPNP_E_INTERNAL_ERROR - Port returned by the socket layer is < 0 | ||||
| *		UPNP_E_SUCCESS	- Success | ||||
| *		 | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int | ||||
| get_miniserver_sockets( MiniServerSockArray * out, | ||||
|                         unsigned short listen_port ) | ||||
| { | ||||
|     char errorBuffer[ERROR_BUFFER_LEN]; | ||||
|     struct sockaddr_in serverAddr; | ||||
|     int listenfd; | ||||
|     int success; | ||||
| @@ -557,10 +575,9 @@ get_miniserver_sockets( MiniServerSockArray * out, | ||||
|     int sockError = UPNP_E_SUCCESS; | ||||
|     int errCode = 0; | ||||
|     int miniServerStopSock; | ||||
|     int ret = 0; | ||||
|  | ||||
|     listenfd = socket( AF_INET, SOCK_STREAM, 0 ); | ||||
|     if ( listenfd == -1 ) { | ||||
|     if( listenfd < 0 ) { | ||||
|         return UPNP_E_OUTOF_SOCKET; // error creating socket | ||||
|     } | ||||
|     // As per the IANA specifications for the use of ports by applications | ||||
| @@ -577,51 +594,51 @@ get_miniserver_sockets( MiniServerSockArray * out, | ||||
|     // Keeping the re-use address code as an optional behaviour that can be  | ||||
|     // turned on if necessary.  | ||||
|     // TURN ON the reuseaddr_on option to use the option. | ||||
|     if ( reuseaddr_on ) { | ||||
|         // THIS IS ALLOWS US TO BIND AGAIN IMMEDIATELY | ||||
|         // AFTER OUR SERVER HAS BEEN CLOSED | ||||
|         // THIS MAY CAUSE TCP TO BECOME LESS RELIABLE | ||||
|         // HOWEVER IT HAS BEEN SUGESTED FOR TCP SERVERS | ||||
|     if( reuseaddr_on ) { | ||||
|         //THIS IS ALLOWS US TO BIND AGAIN IMMEDIATELY | ||||
|         //AFTER OUR SERVER HAS BEEN CLOSED | ||||
|         //THIS MAY CAUSE TCP TO BECOME LESS RELIABLE | ||||
|         //HOWEVER IT HAS BEEN SUGESTED FOR TCP SERVERS | ||||
|  | ||||
|         UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, | ||||
|             "mserv start: resuseaddr set\n" ); | ||||
|         sockError = setsockopt( listenfd, SOL_SOCKET, SO_REUSEADDR, | ||||
|             (const char *)&reuseaddr_on, sizeof (int) ); | ||||
|         if ( sockError == -1 ) { | ||||
|             ( const char * )&reuseaddr_on, sizeof( int )); | ||||
|         if( sockError == UPNP_SOCKETERROR ) { | ||||
|             shutdown( listenfd, SD_BOTH ); | ||||
|             UpnpCloseSocket( listenfd ); | ||||
|  | ||||
|             return UPNP_E_SOCKET_BIND; | ||||
|         } | ||||
|  | ||||
|         sockError = bind( listenfd, (struct sockaddr *)&serverAddr, | ||||
|             sizeof (struct sockaddr_in) ); | ||||
|         sockError = bind( listenfd, | ||||
|                           ( struct sockaddr * )&serverAddr, | ||||
|                           sizeof( struct sockaddr_in ) | ||||
|              ); | ||||
|     } else { | ||||
|         do { | ||||
|             serverAddr.sin_port = htons( listen_port++ ); | ||||
|             sockError = bind( listenfd, (struct sockaddr *)&serverAddr, | ||||
|                 sizeof (struct sockaddr_in) ); | ||||
|             if ( sockError == -1 ) { | ||||
|             sockError = bind( listenfd, | ||||
|                               ( struct sockaddr * )&serverAddr, | ||||
|                               sizeof( struct sockaddr_in ) | ||||
|                  ); | ||||
|             if( sockError == UPNP_SOCKETERROR ) { | ||||
| #ifdef WIN32 | ||||
|                 errCode = WSAGetLastError(); | ||||
| #else | ||||
|                 errCode = errno;  | ||||
| #endif | ||||
|                 if( errno == EADDRINUSE ) { | ||||
|                 if( errno == EADDRINUSE ) | ||||
|                     errCode = 1; | ||||
|                 } | ||||
|             } else | ||||
|                 errCode = 0; | ||||
|  | ||||
|         } while ( errCode != 0 ); | ||||
|         } while( errCode != 0 ); | ||||
|     } | ||||
|  | ||||
|     if ( sockError == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, | ||||
|             "mserv start: Error in bind(): %s\n", errorBuffer ); | ||||
|     if( sockError == UPNP_SOCKETERROR ) { | ||||
|         perror( "mserv start: bind failed" ); | ||||
|         shutdown( listenfd, SD_BOTH ); | ||||
|         UpnpCloseSocket( listenfd ); | ||||
|  | ||||
|         return UPNP_E_SOCKET_BIND;  // bind failed | ||||
|     } | ||||
|  | ||||
| @@ -629,34 +646,28 @@ get_miniserver_sockets( MiniServerSockArray * out, | ||||
|         "mserv start: bind success\n" ); | ||||
|  | ||||
|     success = listen( listenfd, SOMAXCONN ); | ||||
|     if ( success == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, | ||||
|             "mserv start: Error in listen(): %s\n", errorBuffer ); | ||||
|     if( success == UPNP_SOCKETERROR ) { | ||||
|         shutdown( listenfd, SD_BOTH ); | ||||
|         UpnpCloseSocket( listenfd ); | ||||
|  | ||||
|         return UPNP_E_LISTEN; | ||||
|         return UPNP_E_LISTEN;   // listen failed | ||||
|     } | ||||
|  | ||||
|     actual_port = get_port( listenfd ); | ||||
|     if( actual_port <= 0 ) { | ||||
|         shutdown( listenfd, SD_BOTH ); | ||||
|         UpnpCloseSocket( listenfd ); | ||||
|  | ||||
|         return UPNP_E_INTERNAL_ERROR; | ||||
|     } | ||||
|  | ||||
|     out->miniServerPort = actual_port; | ||||
|  | ||||
|     miniServerStopSock = socket( AF_INET, SOCK_DGRAM, 0 ); | ||||
|     if ( miniServerStopSock == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, MSERV, __FILE__, __LINE__, | ||||
|             "Error in socket(): %s\n", errorBuffer ); | ||||
|     if( ( miniServerStopSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == | ||||
|         UPNP_INVALID_SOCKET ) { | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             MSERV, __FILE__, __LINE__, | ||||
|             "Error in socket operation !!!\n" ); | ||||
|         shutdown( listenfd, SD_BOTH ); | ||||
|         UpnpCloseSocket( listenfd ); | ||||
|  | ||||
|         return UPNP_E_OUTOF_SOCKET; | ||||
|     } | ||||
|  | ||||
| @@ -664,9 +675,10 @@ get_miniserver_sockets( MiniServerSockArray * out, | ||||
|     memset( ( char * )&serverAddr, 0, sizeof( struct sockaddr_in ) ); | ||||
|     serverAddr.sin_family = AF_INET; | ||||
|     serverAddr.sin_addr.s_addr = inet_addr( "127.0.0.1" ); | ||||
|     ret = bind( miniServerStopSock, (struct sockaddr *)&serverAddr, | ||||
|         sizeof (serverAddr) ); | ||||
|     if ( ret == -1 ) { | ||||
|  | ||||
|     if( bind( miniServerStopSock, ( struct sockaddr * )&serverAddr, | ||||
|               sizeof( serverAddr ) ) == UPNP_SOCKETERROR ) { | ||||
|  | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             MSERV, __FILE__, __LINE__, | ||||
|             "Error in binding localhost!!!\n" ); | ||||
| @@ -674,51 +686,53 @@ get_miniserver_sockets( MiniServerSockArray * out, | ||||
|         UpnpCloseSocket( listenfd ); | ||||
|         shutdown( miniServerStopSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniServerStopSock ); | ||||
|  | ||||
|         return UPNP_E_SOCKET_BIND; | ||||
|     } | ||||
|  | ||||
|     miniStopSockPort = get_port( miniServerStopSock ); | ||||
|     if ( miniStopSockPort <= 0 ) { | ||||
|     if( miniStopSockPort <= 0 ) { | ||||
|         shutdown( miniServerStopSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniServerStopSock ); | ||||
|         shutdown( listenfd, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniServerStopSock ); | ||||
|         UpnpCloseSocket( listenfd ); | ||||
|  | ||||
|         return UPNP_E_INTERNAL_ERROR; | ||||
|     } | ||||
|  | ||||
|     out->stopPort = miniStopSockPort; | ||||
|  | ||||
|     out->miniServerSock = listenfd; | ||||
|     out->miniServerStopSock = miniServerStopSock; | ||||
|  | ||||
|     return UPNP_E_SUCCESS; | ||||
|  | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: StartMiniServer | ||||
|  * | ||||
|  * Parameters : | ||||
|  *	unsigned short listen_port - Port on which the server listens for  | ||||
|  *		incoming connections | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Initialize the sockets functionality for the  | ||||
|  *	Miniserver. Initialize a thread pool job to run the MiniServer | ||||
|  *	and the job to the thread pool. If listen port is 0, port is  | ||||
|  *	dynamically picked | ||||
|  * | ||||
|  *	Use timer mechanism to start the MiniServer, failure to meet the  | ||||
|  *	allowed delay aborts the attempt to launch the MiniServer. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	Actual port socket is bound to - On Success | ||||
|  *	A negative number UPNP_E_XXX - On Error | ||||
|  ************************************************************************/ | ||||
| *	Function :	StartMiniServer | ||||
| * | ||||
| *	Parameters : | ||||
| *		unsigned short listen_port ; Port on which the server listens for  | ||||
| *									incoming connections | ||||
| * | ||||
| *	Description :	Initialize the sockets functionality for the  | ||||
| *		Miniserver. Initialize a thread pool job to run the MiniServer | ||||
| *		and the job to the thread pool. If listen port is 0, port is  | ||||
| *		dynamically picked | ||||
| * | ||||
| *		Use timer mechanism to start the MiniServer, failure to meet the  | ||||
| *		allowed delay aborts the attempt to launch the MiniServer. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		Actual port socket is bound to - On Success:  | ||||
| *		A negative number UPNP_E_XXX - On Error   			 | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int | ||||
| StartMiniServer( unsigned short listen_port ) | ||||
| { | ||||
|  | ||||
|     int success; | ||||
|  | ||||
|     int count; | ||||
|     int max_count = 10000; | ||||
|  | ||||
| @@ -729,66 +743,69 @@ StartMiniServer( unsigned short listen_port ) | ||||
|         return UPNP_E_INTERNAL_ERROR;   // miniserver running | ||||
|     } | ||||
|  | ||||
|     miniSocket = (MiniServerSockArray *) malloc( sizeof (MiniServerSockArray) ); | ||||
|     if( miniSocket == NULL ) { | ||||
|     miniSocket = | ||||
|         ( MiniServerSockArray * ) malloc( sizeof( MiniServerSockArray ) ); | ||||
|     if( miniSocket == NULL ) | ||||
|         return UPNP_E_OUTOF_MEMORY; | ||||
|     } | ||||
|  | ||||
|     success = get_miniserver_sockets( miniSocket, listen_port ); | ||||
|     if( success != UPNP_E_SUCCESS ) { | ||||
|     if( ( success = get_miniserver_sockets( miniSocket, listen_port ) ) | ||||
|         != UPNP_E_SUCCESS ) { | ||||
|         free( miniSocket ); | ||||
|         return success; | ||||
|     } | ||||
|  | ||||
|     success = get_ssdp_sockets( miniSocket ); | ||||
|     if( success != UPNP_E_SUCCESS ) { | ||||
|     if( ( success = get_ssdp_sockets( miniSocket ) ) != UPNP_E_SUCCESS ) { | ||||
|  | ||||
|         shutdown( miniSocket->miniServerSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerSock ); | ||||
|         shutdown( miniSocket->miniServerStopSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerStopSock ); | ||||
|  | ||||
|         free( miniSocket ); | ||||
|  | ||||
|         return success; | ||||
|     } | ||||
|  | ||||
|     TPJobInit( &job, (start_routine)RunMiniServer, (void *)miniSocket ); | ||||
|     TPJobInit( &job, ( start_routine ) RunMiniServer, | ||||
|                ( void * )miniSocket ); | ||||
|     TPJobSetPriority( &job, MED_PRIORITY ); | ||||
|  | ||||
|     TPJobSetFreeFunction( &job, ( free_routine ) free ); | ||||
|  | ||||
|     success = ThreadPoolAddPersistent( &gMiniServerThreadPool, &job, NULL ); | ||||
|     if ( success < 0 ) { | ||||
|  | ||||
|     if( success < 0 ) { | ||||
|         shutdown( miniSocket->miniServerSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerSock ); | ||||
|         shutdown( miniSocket->miniServerStopSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerStopSock ); | ||||
|         shutdown( miniSocket->ssdpSock, SD_BOTH ); | ||||
|         CLIENTONLY( shutdown( miniSocket->ssdpReqSock, SD_BOTH ) ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerSock ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerStopSock ); | ||||
|         UpnpCloseSocket( miniSocket->ssdpSock ); | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|         shutdown( miniSocket->ssdpReqSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->ssdpReqSock ); | ||||
| #endif | ||||
|  | ||||
|         CLIENTONLY( UpnpCloseSocket( miniSocket->ssdpReqSock ) ); | ||||
|  | ||||
|         return UPNP_E_OUTOF_MEMORY; | ||||
|     } | ||||
|     // wait for miniserver to start | ||||
|     count = 0; | ||||
|     while ( gMServState != MSERV_RUNNING && count < max_count ) { | ||||
|     while( gMServState != MSERV_RUNNING && count < max_count ) { | ||||
|         usleep( 50 * 1000 );    // 0.05s | ||||
|         count++; | ||||
|     } | ||||
|  | ||||
|     // taking too long to start that thread | ||||
|     if ( count >= max_count ) { | ||||
|     if( count >= max_count ) { | ||||
|  | ||||
|         shutdown( miniSocket->miniServerSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerSock ); | ||||
|         shutdown( miniSocket->miniServerStopSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerStopSock ); | ||||
|         shutdown( miniSocket->ssdpSock, SD_BOTH ); | ||||
|         CLIENTONLY( shutdown( miniSocket->ssdpReqSock, SD_BOTH ) ); | ||||
|  | ||||
|         UpnpCloseSocket( miniSocket->miniServerSock ); | ||||
|         UpnpCloseSocket( miniSocket->miniServerStopSock ); | ||||
|         UpnpCloseSocket( miniSocket->ssdpSock ); | ||||
| #ifdef INCLUDE_CLIENT_APIS | ||||
|         shutdown( miniSocket->ssdpReqSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( miniSocket->ssdpReqSock ); | ||||
| #endif | ||||
|         CLIENTONLY( UpnpCloseSocket( miniSocket->ssdpReqSock ) ); | ||||
|  | ||||
|         return UPNP_E_INTERNAL_ERROR; | ||||
|     } | ||||
| @@ -797,39 +814,38 @@ StartMiniServer( unsigned short listen_port ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: StopMiniServer | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	void | ||||
|  * | ||||
|  * Description: | ||||
|  * 	Stop and Shutdown the MiniServer and free socket  | ||||
|  *	resources. | ||||
|  * | ||||
|  * Return: int | ||||
|  *		Always returns 0  | ||||
|  ************************************************************************/ | ||||
| *	Function :	StopMiniServer | ||||
| * | ||||
| *	Parameters : | ||||
| *		void ;	 | ||||
| * | ||||
| *	Description :	Stop and Shutdown the MiniServer and free socket  | ||||
| *		resources. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		Always returns 0  | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int | ||||
| StopMiniServer() | ||||
| StopMiniServer( void ) | ||||
| { | ||||
|     char errorBuffer[ERROR_BUFFER_LEN]; | ||||
|     int socklen = sizeof( struct sockaddr_in ); | ||||
|     int sock; | ||||
|  | ||||
|     int socklen = sizeof( struct sockaddr_in ), | ||||
|       sock; | ||||
|     struct sockaddr_in ssdpAddr; | ||||
|     char buf[256] = "ShutDown"; | ||||
|     int bufLen = strlen( buf ); | ||||
|  | ||||
|     if( gMServState == MSERV_RUNNING ) { | ||||
|     if( gMServState == MSERV_RUNNING ) | ||||
|         gMServState = MSERV_STOPPING; | ||||
|     } else { | ||||
|     else | ||||
|         return 0; | ||||
|     } | ||||
|  | ||||
|     sock = socket( AF_INET, SOCK_DGRAM, 0 ); | ||||
|     if ( sock == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|     if( sock == UPNP_INVALID_SOCKET ) { | ||||
|         UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|             "SSDP_SERVER: StopSSDPServer: Error in socket() %s\n", errorBuffer ); | ||||
|             "SSDP_SERVER:StopSSDPServer: Error in socket operation !!!\n" ); | ||||
|         return 0; | ||||
|     } | ||||
|  | ||||
| @@ -837,16 +853,14 @@ StopMiniServer() | ||||
|         ssdpAddr.sin_family = AF_INET; | ||||
|         ssdpAddr.sin_addr.s_addr = inet_addr( "127.0.0.1" ); | ||||
|         ssdpAddr.sin_port = htons( miniStopSockPort ); | ||||
|         sendto( sock, buf, bufLen, 0, (struct sockaddr *)&ssdpAddr, socklen ); | ||||
|         sendto( sock, buf, bufLen, 0, ( struct sockaddr * )&ssdpAddr, | ||||
|                 socklen ); | ||||
|         usleep( 1000 ); | ||||
|         if( gMServState == MSERV_IDLE ) { | ||||
|         if( gMServState == MSERV_IDLE ) | ||||
|             break; | ||||
| 	} | ||||
|         isleep( 1 ); | ||||
|     } | ||||
|     shutdown( sock, SD_BOTH ); | ||||
|     UpnpCloseSocket( sock ); | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -395,13 +395,8 @@ scanner_get_str( IN scanner_t * scanner ) | ||||
| * | ||||
| * Note : | ||||
| ************************************************************************/ | ||||
| #ifndef WIN32 | ||||
| #warning The only use of the function 'scanner_pushback()' in the code is commented out. | ||||
| #warning 'scanner_pushback()' is a candidate for removal. | ||||
| #else | ||||
| #pragma message ("The only use of the function 'scanner_pushback()' in the code is commented out.") | ||||
| #pragma message ("'scanner_pushback()' is a candidate for removal.") | ||||
| #endif | ||||
| static UPNP_INLINE void | ||||
| scanner_pushback( INOUT scanner_t * scanner, | ||||
|                   IN size_t pushback_bytes ) | ||||
| @@ -970,13 +965,8 @@ read_until_crlf( INOUT scanner_t * scanner, | ||||
| *   PARSE_FAILURE | ||||
| *   PARSE_INCOMPLETE | ||||
| ************************************************************************/ | ||||
| #ifndef WIN32 | ||||
| #warning There are currently no uses of the function 'skip_to_end_of_header()' in the code. | ||||
| #warning 'skip_to_end_of_header()' is a candidate for removal. | ||||
| #else | ||||
| #pragma message("There are currently no uses of the function 'skip_to_end_of_header()' in the code.") | ||||
| #pragma message("'skip_to_end_of_header()' is a candidate for removal.") | ||||
| #endif | ||||
| static UPNP_INLINE int | ||||
| skip_to_end_of_header( INOUT scanner_t * scanner ) | ||||
| { | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -176,7 +176,7 @@ http_get_code_text( int statusCode ) | ||||
|     int table_num; | ||||
|  | ||||
|     if( !gInitialized ) { | ||||
|         init_tables(); | ||||
|         init_tables(  ); | ||||
|     } | ||||
|  | ||||
|     if( statusCode < 100 && statusCode >= 600 ) { | ||||
|   | ||||
| @@ -29,18 +29,20 @@ | ||||
| // | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| /****************************************************************************** | ||||
|  * Purpose: This file defines the Web Server and has functions to carry out | ||||
|  * operations of the Web Server. | ||||
|  ******************************************************************************/ | ||||
| /************************************************************************ | ||||
| * Purpose: This file defines the Web Server and has functions to carry out  | ||||
| * operations of the Web Server.										 | ||||
| ************************************************************************/ | ||||
|  | ||||
| #include "config.h" | ||||
| #include <assert.h> | ||||
| #include <fcntl.h> | ||||
| #ifndef UPNP_USE_BCBPP | ||||
| #ifndef UPNP_USE_MSVCPP | ||||
|     #include <inttypes.h> | ||||
|     #include <stdint.h> | ||||
| #endif | ||||
| #endif | ||||
| #include "util.h" | ||||
| #include "strintmap.h" | ||||
| #include "membuffer.h" | ||||
| @@ -62,11 +64,7 @@ | ||||
| /* | ||||
|    Response Types  | ||||
|  */ | ||||
| enum resp_type { | ||||
| 	RESP_FILEDOC, | ||||
| 	RESP_XMLDOC, | ||||
| 	RESP_HEADERS, | ||||
| 	RESP_WEBDOC, | ||||
| enum resp_type { RESP_FILEDOC, RESP_XMLDOC, RESP_HEADERS, RESP_WEBDOC, | ||||
|         RESP_POST }; | ||||
|  | ||||
| // mapping of file extension to content-type of document | ||||
| @@ -184,9 +182,12 @@ static const char *gEncodedMediaTypes = | ||||
|     "zip\0" APPLICATION_STR "zip\0" "\0"; | ||||
|     // *** end *** | ||||
|  | ||||
| /************************************************************************ | ||||
| /***********************************************************************/ | ||||
| /* | ||||
|    module variables - Globals, static and externs                       | ||||
| ************************************************************************/ | ||||
|  */ | ||||
|  | ||||
| /***********************************************************************/ | ||||
| static struct document_type_t gMediaTypeList[NUM_MEDIA_TYPES]; | ||||
| membuffer gDocumentRootDir;     // a local dir which serves as webserver root | ||||
| static struct xml_alias_t gAliasDoc;    // XML document | ||||
| @@ -194,16 +195,16 @@ static ithread_mutex_t gWebMutex; | ||||
| extern str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES]; | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: has_xml_content_type | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	none | ||||
|  * | ||||
|  * Description: decodes list and stores it in gMediaTypeList | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 void | ||||
|  ************************************************************************/ | ||||
| * Function: has_xml_content_type										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	none																 | ||||
| *																		 | ||||
| * Description: decodes list and stores it in gMediaTypeList				 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 void																 | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE void | ||||
| media_list_init( void ) | ||||
| { | ||||
| @@ -228,20 +229,20 @@ media_list_init( void ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: has_xml_content_type | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char* extension ; | ||||
|  *	OUT const char** con_type, | ||||
|  *	OUT const char** con_subtype | ||||
|  * | ||||
|  * Description: Based on the extension, returns the content type and | ||||
|  *	content subtype | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 0 on success; | ||||
|  *	-1 on error | ||||
|  ************************************************************************/ | ||||
| * Function: has_xml_content_type										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN const char* extension ; 											 | ||||
| *	OUT const char** con_type,											 | ||||
| *	OUT const char** con_subtype										 | ||||
| *																		 | ||||
| * Description: Based on the extension, returns the content type and 	 | ||||
| *	content subtype														 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 0 on success;														 | ||||
| *	-1 on error															 | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE int | ||||
| search_extension( IN const char *extension, | ||||
|                   OUT const char **con_type, | ||||
| @@ -275,20 +276,20 @@ search_extension( IN const char *extension, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: get_content_type | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char* filename, | ||||
|  *	OUT DOMString* content_type | ||||
|  * | ||||
|  * Description: Based on the extension, clones an XML string based on | ||||
|  *	type and content subtype. If content type and sub type are not | ||||
|  *	found, unknown types are used | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 0 - On Sucess | ||||
|  *	 UPNP_E_OUTOF_MEMORY - on memory allocation failures | ||||
|  ************************************************************************/ | ||||
| * Function: get_content_type											 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN const char* filename,											 | ||||
| *	OUT DOMString* content_type											 | ||||
| *																		 | ||||
| * Description: Based on the extension, clones an XML string based on	 | ||||
| *	type and content subtype. If content type and sub type are not		 | ||||
| *	found, unknown types are used										 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 0 - On Sucess														 | ||||
| *	 UPNP_E_OUTOF_MEMORY - on memory allocation failures				 | ||||
| ************************************************************************/ | ||||
| UPNP_INLINE int | ||||
| get_content_type( IN const char *filename, | ||||
|                   OUT DOMString * content_type ) | ||||
| @@ -336,17 +337,17 @@ get_content_type( IN const char *filename, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: glob_alias_init | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	none | ||||
|  * | ||||
|  * Description: Initialize the global XML document. Allocate buffers | ||||
|  *	for the XML document | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 void | ||||
|  ************************************************************************/ | ||||
| * Function: glob_alias_init												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	none																 | ||||
| *																		 | ||||
| * Description: Initialize the global XML document. Allocate buffers		 | ||||
| *	for the XML document												 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 void																 | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE void | ||||
| glob_alias_init( void ) | ||||
| { | ||||
| @@ -359,16 +360,16 @@ glob_alias_init( void ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: is_valid_alias | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const struct xml_alias_t* alias ; XML alias object | ||||
|  * | ||||
|  * Description: Check for the validity of the XML object buffer | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 BOOLEAN | ||||
|  ************************************************************************/ | ||||
| * Function: is_valid_alias												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN const struct xml_alias_t* alias ; XML alias object				 | ||||
| *																		 | ||||
| * Description: Check for the validity of the XML object buffer													 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 BOOLEAN															 | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE xboolean | ||||
| is_valid_alias( IN const struct xml_alias_t *alias ) | ||||
| { | ||||
| @@ -376,17 +377,17 @@ is_valid_alias( IN const struct xml_alias_t *alias ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: alias_grab | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	OUT struct xml_alias_t* alias ; XML alias object | ||||
|  * | ||||
|  * Description: Copy the contents of the global XML document into the | ||||
|  *	local OUT parameter | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 void | ||||
|  ************************************************************************/ | ||||
| * Function: alias_grab													 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	OUT struct xml_alias_t* alias ; XML alias object										 | ||||
| *																		 | ||||
| * Description: Copy the contents of the global XML document into the	 | ||||
| *	local OUT parameter																							 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 void																 | ||||
| ************************************************************************/ | ||||
| static void | ||||
| alias_grab( OUT struct xml_alias_t *alias ) | ||||
| { | ||||
| @@ -401,17 +402,17 @@ alias_grab( OUT struct xml_alias_t *alias ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: alias_release | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN struct xml_alias_t* alias ; XML alias object | ||||
|  * | ||||
|  * Description: Release the XML document referred to by the IN parameter | ||||
|  *	Free the allocated buffers associated with this object | ||||
|  * | ||||
|  * Returns: | ||||
|  *	void | ||||
|  ************************************************************************/ | ||||
| * Function: alias_release												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN struct xml_alias_t* alias ; XML alias object										 | ||||
| *																		 | ||||
| * Description: Release the XML document referred to by the IN parameter  | ||||
| *	Free the allocated buffers associated with this object				 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	void																 | ||||
| ************************************************************************/ | ||||
| static void | ||||
| alias_release( IN struct xml_alias_t *alias ) | ||||
| { | ||||
| @@ -435,24 +436,24 @@ alias_release( IN struct xml_alias_t *alias ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: web_server_set_alias | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	alias_name: webserver name of alias; created by caller and freed by | ||||
|  *		caller (doesn't even have to be malloc()d .) | ||||
|  *	alias_content:	the xml doc; this is allocated by the caller; and | ||||
|  *		freed by the web server | ||||
|  *	alias_content_length: length of alias body in bytes | ||||
|  *	last_modified:	time when the contents of alias were last | ||||
|  *		changed (local time) | ||||
|  * | ||||
|  * Description: Replaces current alias with the given alias. To remove | ||||
|  *	the current alias, set alias_name to NULL. | ||||
|  * | ||||
|  * Returns: | ||||
|  *	0 - OK | ||||
|  *	UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here | ||||
|  ************************************************************************/ | ||||
| * Function: web_server_set_alias										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	alias_name: webserver name of alias; created by caller and freed by  | ||||
| *				caller (doesn't even have to be malloc()d .)					 | ||||
| *	alias_content:	the xml doc; this is allocated by the caller; and	 | ||||
| *					freed by the web server											 | ||||
| *	alias_content_length: length of alias body in bytes					 | ||||
| *	last_modified:	time when the contents of alias were last			 | ||||
| *					changed (local time)											 | ||||
| *																		 | ||||
| * Description: Replaces current alias with the given alias. To remove	 | ||||
| *	the current alias, set alias_name to NULL.							 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	0 - OK																 | ||||
| *	UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here			 | ||||
| ************************************************************************/ | ||||
| int | ||||
| web_server_set_alias( IN const char *alias_name, | ||||
|                       IN const char *alias_content, | ||||
| @@ -515,28 +516,28 @@ web_server_set_alias( IN const char *alias_name, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: web_server_init | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	none | ||||
|  * | ||||
|  * Description: Initilialize the different documents. Initialize the | ||||
|  *	memory for root directory for web server. Call to initialize global | ||||
|  *	XML document. Sets bWebServerState to WEB_SERVER_ENABLED | ||||
|  * | ||||
|  * Returns: | ||||
|  *	0 - OK | ||||
|  *	UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here | ||||
|  ************************************************************************/ | ||||
| * Function: web_server_init												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	none																 | ||||
| *																		 | ||||
| * Description: Initilialize the different documents. Initialize the		 | ||||
| *	memory for root directory for web server. Call to initialize global  | ||||
| *	XML document. Sets bWebServerState to WEB_SERVER_ENABLED			 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	0 - OK																 | ||||
| *	UPNP_E_OUTOF_MEMORY: note: alias_content is not freed here			 | ||||
| ************************************************************************/ | ||||
| int | ||||
| web_server_init( void ) | ||||
| { | ||||
|     int ret_code; | ||||
|  | ||||
|     if( bWebServerState == WEB_SERVER_DISABLED ) { | ||||
|         media_list_init();    // decode media list | ||||
|         media_list_init(  );    // decode media list | ||||
|         membuffer_init( &gDocumentRootDir ); | ||||
|         glob_alias_init(); | ||||
|         glob_alias_init(  ); | ||||
|  | ||||
|         pVirtualDirList = NULL; | ||||
|  | ||||
| @@ -551,18 +552,18 @@ web_server_init( void ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: web_server_destroy | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	none | ||||
|  * | ||||
|  * Description: Release memory allocated for the global web server root | ||||
|  *	directory and the global XML document | ||||
|  *	Resets the flag bWebServerState to WEB_SERVER_DISABLED | ||||
|  * | ||||
|  * Returns: | ||||
|  *	void | ||||
|  ************************************************************************/ | ||||
| * Function: web_server_destroy											 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	none																 | ||||
| *																		 | ||||
| * Description: Release memory allocated for the global web server root	 | ||||
| *	directory and the global XML document								 | ||||
| *	Resets the flag bWebServerState to WEB_SERVER_DISABLED				 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	void																 | ||||
| ************************************************************************/ | ||||
| void | ||||
| web_server_destroy( void ) | ||||
| { | ||||
| @@ -583,22 +584,23 @@ web_server_destroy( void ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: get_file_info | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char* filename ;     Filename having the description document | ||||
|  *	OUT struct File_Info * info ; File information object having file  | ||||
|  *		attributes such as filelength, when was the file last | ||||
|  *		modified, whether a file or a directory and whether the | ||||
|  *		file or directory is readable. | ||||
|  * | ||||
|  * Description: Release memory allocated for the global web server root | ||||
|  *	directory and the global XML document | ||||
|  *	Resets the flag bWebServerState to WEB_SERVER_DISABLED | ||||
|  * | ||||
|  * Returns: | ||||
|  *	int | ||||
|  ************************************************************************/ | ||||
| * Function: get_file_info												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN const char* filename ; 	Filename having the description document | ||||
| *	OUT struct File_Info * info ; File information object having file  | ||||
| *								  attributes such as filelength, when was  | ||||
| *								  the file last modified, whether a file  | ||||
| *								  or a directory and whether the file or | ||||
| *								  directory is readable.  | ||||
| *																		 | ||||
| * Description: Release memory allocated for the global web server root	 | ||||
| *	directory and the global XML document								 | ||||
| *	Resets the flag bWebServerState to WEB_SERVER_DISABLED				 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	int																	 | ||||
| ************************************************************************/ | ||||
| static int | ||||
| get_file_info( IN const char *filename, | ||||
|                OUT struct File_Info *info ) | ||||
| @@ -645,19 +647,19 @@ get_file_info( IN const char *filename, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: web_server_set_root_dir | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char* root_dir ; String having the root directory for the | ||||
|  *		document | ||||
|  * | ||||
|  * Description: Assign the path specfied by the IN const char* root_dir | ||||
|  *	parameter to the global Document root directory. Also check for | ||||
|  *	path names ending in '/' | ||||
|  * | ||||
|  * Returns: | ||||
|  *	int | ||||
|  ************************************************************************/ | ||||
| * Function: web_server_set_root_dir										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN const char* root_dir ; String having the root directory for the  | ||||
| *								document		 						 | ||||
| *																		 | ||||
| * Description: Assign the path specfied by the IN const char* root_dir	 | ||||
| *	parameter to the global Document root directory. Also check for		 | ||||
| *	path names ending in '/'											 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	int																	 | ||||
| ************************************************************************/ | ||||
| int | ||||
| web_server_set_root_dir( IN const char *root_dir ) | ||||
| { | ||||
| @@ -680,23 +682,24 @@ web_server_set_root_dir( IN const char *root_dir ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: get_alias | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char* request_file ; request file passed in to be compared with | ||||
|  *	OUT struct xml_alias_t* alias ; xml alias object which has a file name | ||||
|  *		stored | ||||
|  *   OUT struct File_Info * info	 ; File information object which will be | ||||
|  *		filled up if the file comparison succeeds | ||||
|  * | ||||
|  * Description: Compare the files names between the one on the XML alias | ||||
|  *	the one passed in as the input parameter. If equal extract file | ||||
|  *	information | ||||
|  * | ||||
|  * Returns: | ||||
|  *	TRUE - On Success | ||||
|  *	FALSE if request is not an alias | ||||
|  ************************************************************************/ | ||||
| * Function: get_alias													 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN const char* request_file ; request file passed in to be compared with | ||||
| *	OUT struct xml_alias_t* alias ; xml alias object which has a file name  | ||||
| *									stored										 | ||||
| *   OUT struct File_Info * info	 ; File information object which will be  | ||||
| *									filled up if the file comparison  | ||||
| *									succeeds										 | ||||
| *																		 | ||||
| * Description: Compare the files names between the one on the XML alias  | ||||
| *	the one passed in as the input parameter. If equal extract file  | ||||
| *	information | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	TRUE - On Success													 | ||||
| *	FALSE if request is not an alias									 | ||||
| ************************************************************************/ | ||||
| static UPNP_INLINE xboolean | ||||
| get_alias( IN const char *request_file, | ||||
|            OUT struct xml_alias_t *alias, | ||||
| @@ -717,17 +720,17 @@ get_alias( IN const char *request_file, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: isFileInVirtualDir | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char *filePath ; directory path to be tested for virtual directory | ||||
|  * | ||||
|  * Description: Compares filePath with paths from the list of virtual | ||||
|  *	directory lists | ||||
|  * | ||||
|  * Returns: | ||||
|  *	BOOLEAN	 | ||||
|  ************************************************************************/ | ||||
| * Function: isFileInVirtualDir											 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN char *filePath ; directory path to be tested for virtual directory | ||||
| *																		 | ||||
| * Description: Compares filePath with paths from the list of virtual | ||||
| *				directory lists | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	BOOLEAN																 | ||||
| ************************************************************************/ | ||||
| int | ||||
| isFileInVirtualDir( IN char *filePath ) | ||||
| { | ||||
| @@ -743,7 +746,7 @@ isFileInVirtualDir( IN char *filePath ) | ||||
|                 return TRUE; | ||||
|         } else { | ||||
|             if( ( strncmp( pCurVirtualDir->dirName, filePath, webDirLen ) | ||||
|                   == 0 ) && ( filePath[webDirLen] == '/' || filePath[webDirLen] == '\0' || filePath[webDirLen] == '?' ) ) | ||||
|                   == 0 ) && ( filePath[webDirLen] == '/' ) ) | ||||
|                 return TRUE; | ||||
|         } | ||||
|  | ||||
| @@ -754,16 +757,16 @@ isFileInVirtualDir( IN char *filePath ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: ToUpperCase | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	INOUT char * Str ; Input string to be converted | ||||
|  * | ||||
|  * Description: Converts input string to upper case | ||||
|  * | ||||
|  * Returns: | ||||
|  *	int | ||||
|  ************************************************************************/ | ||||
| * Function: ToUpperCase | ||||
| * | ||||
| * Parameters: | ||||
| *	INOUT char * Str ; Input string to be converted | ||||
| * | ||||
| * Description: Converts input string to upper case | ||||
| * | ||||
| * Returns: | ||||
| *	int | ||||
| ************************************************************************/ | ||||
| int | ||||
| ToUpperCase( char *Str ) | ||||
| { | ||||
| @@ -776,17 +779,17 @@ ToUpperCase( char *Str ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: StrStr | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char * S1 ; Input string | ||||
|  *	IN char * S2 ; Input sub-string | ||||
|  * | ||||
|  * Description: Finds a substring from a string | ||||
|  * | ||||
|  * Returns: | ||||
|  *	char * ptr - pointer to the first occurence of S2 in S1 | ||||
|  ************************************************************************/ | ||||
| * Function: StrStr | ||||
| * | ||||
| * Parameters: | ||||
| *	IN char * S1 ; Input string | ||||
| *	IN char * S2 ; Input sub-string | ||||
| * | ||||
| * Description: Finds a substring from a string | ||||
| * | ||||
| * Returns: | ||||
| *	char * ptr - pointer to the first occurence of S2 in S1				 | ||||
| ************************************************************************/ | ||||
| char * | ||||
| StrStr( char *S1, | ||||
|         char *S2 ) | ||||
| @@ -826,17 +829,17 @@ StrStr( char *S1, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: StrTok | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char ** Src ; String containing the token | ||||
|  *	IN char * del ; Set of delimiter characters | ||||
|  * | ||||
|  * Description: Finds next token in a string | ||||
|  * | ||||
|  * Returns: | ||||
|  *	char * ptr - pointer to the first occurence of S2 in S1 | ||||
|  ************************************************************************/ | ||||
| * Function: StrTok														 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN char ** Src ; String containing the token													 | ||||
| *	IN char * del ; Set of delimiter characters														 | ||||
| *																		 | ||||
| * Description: Finds next token in a string							 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	char * ptr - pointer to the first occurence of S2 in S1				 | ||||
| ************************************************************************/ | ||||
| char * | ||||
| StrTok( char **Src, | ||||
|         char *Del ) | ||||
| @@ -860,41 +863,39 @@ StrTok( char **Src, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: GetNextRange | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char ** SrcRangeStr ; string containing the token / range | ||||
|  *	OUT int * FirstByte ;	 gets the first byte of the token | ||||
|  *	OUT int * LastByte	; gets the last byte of the token | ||||
|  * | ||||
|  * Description: Returns a range of integers from a string | ||||
|  * | ||||
|  * Returns: int	; | ||||
|  *	always returns 1; | ||||
|  ************************************************************************/ | ||||
| * Function: GetNextRange												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN char ** SrcRangeStr ; string containing the token / range										 | ||||
| *	OUT int * FirstByte ;	 gets the first byte of the token												 | ||||
| *	OUT int * LastByte	; gets the last byte of the token												 | ||||
| *																		 | ||||
| * Description: Returns a range of integers from a sring					 | ||||
| *																		 | ||||
| * Returns: int	; | ||||
| *	always returns 1;				 | ||||
| ************************************************************************/ | ||||
| int | ||||
| GetNextRange( char **SrcRangeStr, | ||||
|               off_t *FirstByte, | ||||
|               off_t *LastByte ) | ||||
| { | ||||
|     char *Ptr; | ||||
|     char *Tok; | ||||
|     int i; | ||||
|     int64_t F = -1; | ||||
|     int64_t L = -1; | ||||
|     char *Ptr, | ||||
|      *Tok; | ||||
|     int i, | ||||
|       F = -1, | ||||
|       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, "%"SCNd64"%"SCNd64, &F, &L ); | ||||
|     sscanf( Tok, "%d%d", &F, &L ); | ||||
|  | ||||
|     if( F == -1 || L == -1 ) { | ||||
|         *Ptr = '-'; | ||||
| @@ -909,35 +910,36 @@ GetNextRange( char **SrcRangeStr, | ||||
|         } | ||||
|  | ||||
|         if( Is_Suffix_byte_Range ) { | ||||
|             *FirstByte = (off_t)L; | ||||
|             *LastByte = (off_t)F; | ||||
|             *FirstByte = L; | ||||
|             *LastByte = F; | ||||
|             return 1; | ||||
|         } | ||||
|     } | ||||
|     *FirstByte = (off_t)F; | ||||
|     *LastByte = (off_t)L; | ||||
|  | ||||
|     *FirstByte = F; | ||||
|     *LastByte = L; | ||||
|     return 1; | ||||
|  | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: CreateHTTPRangeResponseHeader | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	char * ByteRangeSpecifier ; String containing the range | ||||
|  *	long FileLength ; Length of the file | ||||
|  *	OUT struct SendInstruction * Instr ; SendInstruction object | ||||
|  *		where the range operations will be stored | ||||
|  * | ||||
|  * Description: Fills in the Offset, read size and contents to send out | ||||
|  *	as an HTTP Range Response | ||||
|  * | ||||
|  * Returns: | ||||
|  *	HTTP_BAD_REQUEST | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE | ||||
|  *	HTTP_OK	 | ||||
|  ************************************************************************/ | ||||
| * Function: CreateHTTPRangeResponseHeader								 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	char * ByteRangeSpecifier ; String containing the range 	 | ||||
| *	long FileLength ; Length of the file													 | ||||
| *	OUT struct SendInstruction * Instr ; SendInstruction object	where the  | ||||
| *										range operations will be stored | ||||
| *																		 | ||||
| * Description: Fills in the Offset, read size and contents to send out	 | ||||
| *	as an HTTP Range Response											 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	HTTP_BAD_REQUEST													 | ||||
| *	UPNP_E_OUTOF_MEMORY													 | ||||
| *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE									 | ||||
| *	HTTP_OK																 | ||||
| ************************************************************************/ | ||||
| int | ||||
| CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier, | ||||
|                                off_t FileLength, | ||||
| @@ -1033,24 +1035,24 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: CheckOtherHTTPHeaders | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN http_message_t * Req ;  HTTP Request message | ||||
|  *	OUT struct SendInstruction * RespInstr ; Send Instruction object to | ||||
|  *		data for the response | ||||
|  *	int FileSize ;	Size of the file containing the request document | ||||
|  * | ||||
|  * Description: Get header id from the request parameter and take | ||||
|  *	appropriate action based on the ids. | ||||
|  *	as an HTTP Range Response | ||||
|  * | ||||
|  * Returns: | ||||
|  *	HTTP_BAD_REQUEST | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE | ||||
|  *	HTTP_OK | ||||
|  ************************************************************************/ | ||||
| * Function: CheckOtherHTTPHeaders										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN http_message_t * Req ;  HTTP Request message | ||||
| *	OUT struct SendInstruction * RespInstr ; Send Instruction object to  | ||||
| *							data for the response | ||||
| *	int FileSize ;	Size of the file containing the request document | ||||
| *																		 | ||||
| * Description: Get header id from the request parameter and take		 | ||||
| *	appropriate action based on the ids.								 | ||||
| *	as an HTTP Range Response											 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	HTTP_BAD_REQUEST													 | ||||
| *	UPNP_E_OUTOF_MEMORY													 | ||||
| *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE									 | ||||
| *	HTTP_OK																 | ||||
| ************************************************************************/ | ||||
| int | ||||
| CheckOtherHTTPHeaders( IN http_message_t * Req, | ||||
|                        OUT struct SendInstruction *RespInstr, | ||||
| @@ -1164,27 +1166,27 @@ CheckOtherHTTPHeaders( IN http_message_t * Req, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: process_request | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN http_message_t *req ; HTTP Request message | ||||
|  *	OUT enum resp_type *rtype ; Tpye of response | ||||
|  *	OUT membuffer *headers ; | ||||
|  *	OUT membuffer *filename ; Get filename from request document | ||||
|  *	OUT struct xml_alias_t *alias ; Xml alias document from the | ||||
|  *		request document, | ||||
|  *	OUT struct SendInstruction * RespInstr ; Send Instruction object | ||||
|  *		where the response is set up. | ||||
|  * | ||||
|  * Description: Processes the request and returns the result in the OUT | ||||
|  *	parameters | ||||
|  * | ||||
|  * Returns: | ||||
|  *	HTTP_BAD_REQUEST | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE | ||||
|  *	HTTP_OK | ||||
|  ************************************************************************/ | ||||
| * Function: process_request												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN http_message_t *req ; HTTP Request message												 | ||||
| *	OUT enum resp_type *rtype ; Tpye of response											 | ||||
| *	OUT membuffer *headers ; 												 | ||||
| *	OUT membuffer *filename ; Get filename from request document | ||||
| *	OUT struct xml_alias_t *alias ; Xml alias document from the  | ||||
| *									request document,										 | ||||
| *	OUT struct SendInstruction * RespInstr ; Send Instruction object  | ||||
| *					where the response is set up.										 | ||||
| *																		 | ||||
| * Description: Processes the request and returns the result in the OUT	 | ||||
| *	parameters															 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	HTTP_BAD_REQUEST													 | ||||
| *	UPNP_E_OUTOF_MEMORY													 | ||||
| *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE									 | ||||
| *	HTTP_OK																 | ||||
| ************************************************************************/ | ||||
| static int | ||||
| process_request( IN http_message_t * req, | ||||
|                  OUT enum resp_type *rtype, | ||||
| @@ -1492,23 +1494,23 @@ process_request( IN http_message_t * req, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_RecvPostMessage | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	http_parser_t* parser ; HTTP Parser object | ||||
|  *	IN SOCKINFO *info ; Socket Information object | ||||
|  *	char * filename ; 	File where received data is copied to | ||||
|  *	struct SendInstruction * Instr	; Send Instruction object which gives | ||||
|  *		information whether the file is a virtual file or not. | ||||
|  * | ||||
|  * Description: Receives the HTTP post message | ||||
|  * | ||||
|  * Returns: | ||||
|  *	HTTP_INTERNAL_SERVER_ERROR | ||||
|  *	HTTP_UNAUTHORIZED | ||||
|  *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE | ||||
|  *	HTTP_OK | ||||
|  ************************************************************************/ | ||||
| * Function: http_RecvPostMessage										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	http_parser_t* parser ; HTTP Parser object							 | ||||
| *	IN SOCKINFO *info ; Socket Information object													 | ||||
| *	char * filename ; 	File where received data is copied to | ||||
| *	struct SendInstruction * Instr	; Send Instruction object which gives | ||||
| *			information whether the file is a virtual file or not. | ||||
| *																		 | ||||
| * Description: Receives the HTTP post message														 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	HTTP_INTERNAL_SERVER_ERROR											 | ||||
| *	HTTP_UNAUTHORIZED													 | ||||
| *	HTTP_REQUEST_RANGE_NOT_SATISFIABLE									 | ||||
| *	HTTP_OK																 | ||||
| ************************************************************************/ | ||||
| int | ||||
| http_RecvPostMessage( http_parser_t * parser, | ||||
|                       IN SOCKINFO * info, | ||||
| @@ -1529,7 +1531,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; | ||||
|         } | ||||
| @@ -1656,19 +1658,19 @@ http_RecvPostMessage( http_parser_t * parser, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: web_server_callback | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN http_parser_t *parser ; HTTP Parser Object | ||||
|  *	INOUT http_message_t* req ; HTTP Message request | ||||
|  *	IN SOCKINFO *info ;	Socket information object | ||||
|  * | ||||
|  * Description: main entry point into web server; | ||||
|  *	handles HTTP GET and HEAD requests | ||||
|  * | ||||
|  * Returns: | ||||
|  *	void | ||||
|  ************************************************************************/ | ||||
| * Function: web_server_callback											 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN http_parser_t *parser ; HTTP Parser Object						 | ||||
| *	INOUT http_message_t* req ; HTTP Message request										 | ||||
| *	IN SOCKINFO *info ;			Socket information object													 | ||||
| *																		 | ||||
| * Description: main entry point into web server;						 | ||||
| *	handles HTTP GET and HEAD requests									 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	void																 | ||||
| ************************************************************************/ | ||||
| void | ||||
| web_server_callback( IN http_parser_t * parser, | ||||
|                      INOUT http_message_t * req, | ||||
| @@ -1761,4 +1763,3 @@ web_server_callback( IN http_parser_t * parser, | ||||
|     membuffer_destroy( &headers ); | ||||
|     membuffer_destroy( &filename ); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -555,7 +555,7 @@ parse_hostport( const char *in, | ||||
|     int begin_port; | ||||
|     int hostport_size = 0; | ||||
|     int host_size = 0; | ||||
| #if !defined(WIN32) && !(defined(__OSX__) || defined(__APPLE__)) | ||||
| #ifndef WIN32 | ||||
|     char temp_hostbyname_buff[BUFFER_SIZE]; | ||||
|     struct hostent h_buf; | ||||
| #endif | ||||
| @@ -626,35 +626,27 @@ 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, | ||||
|         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 = lwres_gethostbyname_r( temp_host_name, | ||||
|                                    &h_buf, | ||||
|                                    temp_hostbyname_buff, | ||||
|                                    BUFFER_SIZE, &errcode ); | ||||
|         if ( h == NULL ) { | ||||
|             errCode = 1; | ||||
|         } | ||||
| #elif defined(__OSX__) || defined(__APPLE__) | ||||
|         h = gethostbyname(temp_host_name); | ||||
|         if ( h == NULL ) { | ||||
|                 errCode = 1; | ||||
|         } | ||||
| #elif defined(__linux__) | ||||
|         errCode = gethostbyname_r( | ||||
|                 temp_host_name, | ||||
|         errCode = gethostbyname_r( temp_host_name, | ||||
|                                    &h_buf, | ||||
|                                    temp_hostbyname_buff, | ||||
|                                    BUFFER_SIZE, &h, &errcode ); | ||||
| #else | ||||
|         { | ||||
| { | ||||
|            struct addrinfo hints, *res, *res0; | ||||
|  | ||||
| 	   h = NULL; | ||||
| @@ -679,8 +671,9 @@ parse_hostport( const char *in, | ||||
|                } | ||||
|                freeaddrinfo(res0); | ||||
|            } | ||||
|         } | ||||
| } | ||||
| #endif  | ||||
|  | ||||
|         if( errCode == 0 ) { | ||||
|             if( h ) { | ||||
|                 if( ( h->h_addrtype == AF_INET ) && ( h->h_length == 4 ) ) { | ||||
|   | ||||
| @@ -32,7 +32,6 @@ | ||||
| #ifndef INTERNAL_CONFIG_H | ||||
| #define INTERNAL_CONFIG_H  | ||||
|  | ||||
|  | ||||
| #include "autoconfig.h" | ||||
|  | ||||
|  | ||||
| @@ -262,7 +261,7 @@ | ||||
|  | ||||
| /** @name Other debugging features | ||||
|           The UPnP SDK contains other features to aid in debugging: | ||||
| 	  see <upnp/inc/upnpdebug.h> | ||||
| 	  see <upnp/upnpdebug.h> | ||||
|  */ | ||||
|  | ||||
| #define DEBUG_ALL		1    | ||||
|   | ||||
| @@ -50,78 +50,73 @@ int | ||||
| http_CancelHttpGet( IN void *Handle ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_FixUrl | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN uri_type* url;		URL to be validated and fixed | ||||
|  *	OUT uri_type* fixed_url;	URL after being fixed. | ||||
|  * | ||||
|  * Description: | ||||
|  *	Validates URL | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 UPNP_E_INVALID_URL | ||||
|  * 	 UPNP_E_SUCCESS | ||||
|  ************************************************************************/ | ||||
| * Function: http_FixUrl													 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN uri_type* url ;			URL to be validated and fixed | ||||
| *	OUT uri_type* fixed_url ;	URL after being fixed. | ||||
| *																		 | ||||
| * Description: Validates URL											 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 UPNP_E_INVALID_URL													 | ||||
| * 	 UPNP_E_SUCCESS														 | ||||
| ************************************************************************/ | ||||
| int http_FixUrl( IN uri_type* url, OUT uri_type* fixed_url ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_FixStrUrl | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char* urlstr ; 		Character string as a URL | ||||
|  *	IN int urlstrlen ; 		Length of the character string | ||||
|  *	OUT uri_type* fixed_url	;	Fixed and corrected URL | ||||
|  * | ||||
|  * Description: | ||||
|  *	Parses URL and then validates URL | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 UPNP_E_INVALID_URL | ||||
|  * 	 UPNP_E_SUCCESS | ||||
|  ************************************************************************/ | ||||
| * Function: http_FixStrUrl												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN char* urlstr ; 			Character string as a URL				 | ||||
| *	IN int urlstrlen ; 			Length of the character string								 | ||||
| *	OUT uri_type* fixed_url	;	Fixed and corrected URL | ||||
| *																		 | ||||
| * Description: Parses URL and then validates URL						 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 UPNP_E_INVALID_URL													 | ||||
| * 	 UPNP_E_SUCCESS														 | ||||
| ************************************************************************/ | ||||
| int http_FixStrUrl( IN char* urlstr, IN int urlstrlen, OUT uri_type* fixed_url ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_Connect | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN uri_type* destination_url;	URL containing destination information | ||||
|  *	OUT uri_type *url;		Fixed and corrected URL | ||||
|  * | ||||
|  * Description: | ||||
|  *	Gets destination address from URL and then connects to the remote end | ||||
|  * | ||||
|  *  Returns: | ||||
|  *	socket descriptor on sucess | ||||
|  *	UPNP_E_OUTOF_SOCKET | ||||
|  *	UPNP_E_SOCKET_CONNECT on error | ||||
|  ************************************************************************/ | ||||
| * Function: http_Connect												 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN uri_type* destination_url ; URL containing destination information					 | ||||
| *	OUT uri_type *url ;			   Fixed and corrected URL | ||||
| *																		 | ||||
| * Description: Gets destination address from URL and then connects to the  | ||||
| *	remote end | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	socket descriptor on sucess											 | ||||
| *	UPNP_E_OUTOF_SOCKET													 | ||||
| *	UPNP_E_SOCKET_CONNECT on error										 | ||||
| ************************************************************************/ | ||||
| int http_Connect( IN uri_type* destination_url, OUT uri_type *url ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_RecvMessage | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN SOCKINFO *info;			Socket information object | ||||
|  *	OUT http_parser_t* parser;		HTTP parser object | ||||
|  *	IN http_method_t request_method;	HTTP request method | ||||
|  *	IN OUT int* timeout_secs;		time out | ||||
|  *	OUT int* http_error_code;		HTTP error code returned | ||||
|  * | ||||
|  * Description: | ||||
|  *	Get the data on the socket and take actions based on the read data | ||||
|  *	to modify the parser objects buffer. If an error is reported while | ||||
|  *	parsing the data, the error code is passed in the http_errr_code | ||||
|  *	parameter | ||||
|  * | ||||
|  * Returns: | ||||
|  *	 UPNP_E_BAD_HTTPMSG | ||||
|  * 	 UPNP_E_SUCCESS | ||||
|  ************************************************************************/ | ||||
| * Function: http_RecvMessage											 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN SOCKINFO *info ;					Socket information object | ||||
| *	OUT http_parser_t* parser,			HTTP parser object | ||||
| *	IN http_method_t request_method ;	HTTP request method					 | ||||
| *	IN OUT int* timeout_secs ;			time out											 | ||||
| *	OUT int* http_error_code ;			HTTP error code returned | ||||
| *																		 | ||||
| * Description: Get the data on the socket and take actions based on the  | ||||
| *	read data to modify the parser objects buffer. If an error is reported  | ||||
| *	while parsing the data, the error code is passed in the http_errr_code  | ||||
| *	parameter | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	 UPNP_E_BAD_HTTPMSG													 | ||||
| * 	 UPNP_E_SUCCESS														 | ||||
| ************************************************************************/ | ||||
| int http_RecvMessage( IN SOCKINFO *info, OUT http_parser_t* parser, | ||||
| 		IN http_method_t request_method,  | ||||
| 		IN OUT int* timeout_secs, | ||||
| @@ -129,311 +124,302 @@ int http_RecvMessage( IN SOCKINFO *info, OUT http_parser_t* parser, | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_SendMessage | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN SOCKINFO *info ;		Socket information object | ||||
|  *	IN OUT int * TimeOut ;		time out value | ||||
|  *	IN const char* fmt, ...	 Pattern format to take actions upon | ||||
|  * | ||||
|  * Description: | ||||
|  *	Sends a message to the destination based on the | ||||
|  *	IN const char* fmt parameter | ||||
|  *	fmt types: | ||||
|  *		'f':	arg = const char * file name | ||||
|  *		'm':	arg1 = const char * mem_buffer; arg2= size_t buf_length | ||||
|  *	E.g.: | ||||
|  *		char *buf = "POST /xyz.cgi http/1.1\r\n\r\n"; | ||||
|  *		char *filename = "foo.dat"; | ||||
|  *		int status = http_SendMessage( tcpsock, "mf", | ||||
|  *			buf, strlen(buf),	// args for memory buffer | ||||
|  *			filename );		// arg for file | ||||
|  * | ||||
|  * Returns: | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  * 	UPNP_E_FILE_READ_ERROR | ||||
|  *	UPNP_E_SUCCESS | ||||
|  ************************************************************************/ | ||||
| int http_SendMessage( | ||||
| 	IN SOCKINFO *info, | ||||
| 	IN OUT int* timeout_secs,  | ||||
| * Function: http_SendMessage											 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN SOCKINFO *info ;		Socket information object | ||||
| *	IN OUT int * TimeOut ; 	time out value											 | ||||
| *	IN const char* fmt, ...	 Pattern format to take actions upon								 | ||||
| *																		 | ||||
| * Description: Sends a message to the destination based on the			 | ||||
| *	IN const char* fmt parameter										 | ||||
| *	fmt types:															 | ||||
| *		'f':	arg = const char * file name							 | ||||
| *		'm':	arg1 = const char * mem_buffer; arg2= size_t buf_length	 | ||||
| *	E.g.:																 | ||||
| *		char *buf = "POST /xyz.cgi http/1.1\r\n\r\n";					 | ||||
| *		char *filename = "foo.dat";										 | ||||
| *		int status = http_SendMessage( tcpsock, "mf",					 | ||||
| *					buf, strlen(buf),	// args for memory buffer		 | ||||
| *					filename );			// arg for file					 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	UPNP_E_OUTOF_MEMORY													 | ||||
| * 	UPNP_E_FILE_READ_ERROR												 | ||||
| *	UPNP_E_SUCCESS														 | ||||
| ************************************************************************/ | ||||
| int http_SendMessage( IN SOCKINFO *info, IN OUT int* timeout_secs,  | ||||
| 					  IN const char* fmt, ... ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_RequestAndResponse | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN uri_type* destination;	Destination URI object which contains | ||||
|  *					remote IP address among other elements | ||||
|  *	IN const char* request;		Request to be sent | ||||
|  *	IN size_t request_length;	Length of the request | ||||
|  *	IN http_method_t req_method;	HTTP Request method | ||||
|  *	IN int timeout_secs;		time out value | ||||
|  *	OUT http_parser_t* response;	Parser object to receive the repsonse | ||||
|  * | ||||
|  * Description: | ||||
|  *	Initiates socket, connects to the destination, sends a | ||||
|  *	request and waits for the response from the remote end | ||||
|  * | ||||
|  * Returns: | ||||
|  *	UPNP_E_SOCKET_ERROR | ||||
|  * 	UPNP_E_SOCKET_CONNECT | ||||
|  *	Error Codes returned by http_SendMessage | ||||
|  *	Error Codes returned by http_RecvMessage | ||||
|  ************************************************************************/ | ||||
| int http_RequestAndResponse( | ||||
| 	IN uri_type* destination, | ||||
| 	IN const char* request, | ||||
| 	IN size_t request_length, | ||||
| * Function: http_RequestAndResponse										 | ||||
| *																		 | ||||
| * Parameters:															 | ||||
| *	IN uri_type* destination ;		Destination URI object which contains  | ||||
| *									remote IP address among other elements | ||||
| *	IN const char* request ;		Request to be sent | ||||
| *	IN size_t request_length ;		Length of the request | ||||
| *	IN http_method_t req_method ;	HTTP Request method | ||||
| *	IN int timeout_secs ;			time out value | ||||
| *	OUT http_parser_t* response	;	Parser object to receive the repsonse | ||||
| *																		 | ||||
| * Description: Initiates socket, connects to the destination, sends a	 | ||||
| *	request and waits for the response from the remote end				 | ||||
| *																		 | ||||
| * Returns:																 | ||||
| *	UPNP_E_SOCKET_ERROR													 | ||||
| * 	UPNP_E_SOCKET_CONNECT												 | ||||
| *	Error Codes returned by http_SendMessage							 | ||||
| *	Error Codes returned by http_RecvMessage							 | ||||
| ************************************************************************/ | ||||
| int http_RequestAndResponse( IN uri_type* destination, | ||||
| 						   IN const char* request, IN size_t request_length, | ||||
| 						   IN http_method_t req_method, | ||||
| 						   IN int timeout_secs,  | ||||
| 						   OUT http_parser_t* response ); | ||||
|  | ||||
| /************************************************************************ | ||||
| *  return codes: | ||||
| *		0 -- success | ||||
| *		UPNP_E_OUTOF_MEMORY | ||||
| *		UPNP_E_TIMEDOUT | ||||
| *		UPNP_E_BAD_REQUEST | ||||
| *		UPNP_E_BAD_RESPONSE | ||||
| *		UPNP_E_INVALID_URL | ||||
| *		UPNP_E_SOCKET_READ | ||||
| *		UPNP_E_SOCKET_WRITE | ||||
| ************************************************************************/ | ||||
|  | ||||
| /************************************************************************ | ||||
|  * return codes: | ||||
|  *	0 -- success | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_TIMEDOUT | ||||
|  *	UPNP_E_BAD_REQUEST | ||||
|  *	UPNP_E_BAD_RESPONSE | ||||
|  *	UPNP_E_INVALID_URL | ||||
|  *	UPNP_E_SOCKET_READ | ||||
|  *	UPNP_E_SOCKET_WRITE | ||||
|  ************************************************************************/ | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_Download | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char* url_str;	String as a URL | ||||
|  *	IN int timeout_secs;	time out value | ||||
|  *	OUT char** document;	buffer to store the document extracted | ||||
|  *				from the donloaded message. | ||||
|  *	OUT int* doc_length;	length of the extracted document | ||||
|  *	OUT char* content_type;	Type of content | ||||
|  * | ||||
|  * Description: | ||||
|  *	Download the document message and extract the document  | ||||
|  *	from the message. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS | ||||
|  *	UPNP_E_INVALID_URL | ||||
|  ************************************************************************/ | ||||
| int http_Download( | ||||
| 	IN const char* url,  | ||||
| *	Function :	http_Download | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN const char* url_str :	String as a URL | ||||
| *		IN int timeout_secs :		time out value | ||||
| *		OUT char** document :		buffer to store the document extracted | ||||
| *									from the donloaded message. | ||||
| *		OUT int* doc_length :		length of the extracted document | ||||
| *	    OUT char* content_type :	Type of content | ||||
| * | ||||
| *	Description :	Download the document message and extract the document  | ||||
| *		from the message. | ||||
| * | ||||
| *	Return : int; | ||||
| *		UPNP_E_SUCCESS; | ||||
| *		UPNP_E_INVALID_URL; | ||||
| *			 | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_Download( IN const char* url,  | ||||
| 				   IN int timeout_secs, | ||||
| 	OUT char** document, | ||||
| 	OUT int* doc_length, | ||||
| 				   OUT char** document, OUT int* doc_length, | ||||
| 				   OUT char* content_type ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_WriteHttpPost | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *Handle:	Handle to the http post object | ||||
|  *	IN char *buf:		Buffer to send to peer, if format used | ||||
|  *				is not UPNP_USING_CHUNKED,  | ||||
|  *	IN unsigned int *size:	Size of the data to be sent. | ||||
|  *	IN int timeout:		time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Formats data if format used is UPNP_USING_CHUNKED. | ||||
|  *	Writes data on the socket connected to the peer. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS - On Success | ||||
|  *	UPNP_E_INVALID_PARAM - Invalid Parameter | ||||
|  *	-1 - On Socket Error. | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_WriteHttpPost | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN void *Handle :		Handle to the http post object | ||||
| *		IN char *buf :			Buffer to send to peer, if format used | ||||
| *								is not UPNP_USING_CHUNKED,  | ||||
| *		IN unsigned int *size :	Size of the data to be sent. | ||||
| *		IN int timeout :		time out value | ||||
| * | ||||
| *	Description :	Formats data if format used is UPNP_USING_CHUNKED. | ||||
| *		Writes data on the socket connected to the peer. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		UPNP_E_SUCCESS - On Success | ||||
| *		UPNP_E_INVALID_PARAM - Invalid Parameter | ||||
| *		-1 - On Socket Error. | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_WriteHttpPost(IN void *Handle, | ||||
| 		       IN char *buf, | ||||
| 		       IN unsigned int *size, | ||||
| 		       IN int timeout); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_CloseHttpPost | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *Handle;	Handle to the http post object | ||||
|  *	IN OUT int *httpStatus;	HTTP status returned on receiving a | ||||
|  *				response message | ||||
|  *	IN int timeout;		time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Sends remaining data if using  UPNP_USING_CHUNKED  | ||||
|  *	format. Receives any more messages. Destroys socket and any socket | ||||
|  *	associated memory. Frees handle associated with the HTTP POST msg. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Sucess | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Parameter | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_CloseHttpPost | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN void *Handle :			Handle to the http post object | ||||
| *		IN OUT int *httpStatus :	HTTP status returned on receiving a | ||||
| *									response message | ||||
| *		IN int timeout :			time out value | ||||
| * | ||||
| *	Description :	Sends remaining data if using  UPNP_USING_CHUNKED  | ||||
| *		format. Receives any more messages. Destroys socket and any socket | ||||
| *		associated memory. Frees handle associated with the HTTP POST msg. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		UPNP_E_SUCCESS - On Sucess ; | ||||
| *		UPNP_E_INVALID_PARAM  - Invalid Parameter; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_CloseHttpPost(IN void *Handle,  | ||||
| 		       IN OUT int *httpStatus, | ||||
| 		       IN int timeout); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_OpenHttpPost | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char *url_str;		String as a URL	 | ||||
|  *	IN OUT void **Handle;		Pointer to buffer to store HTTP | ||||
|  *					post handle | ||||
|  *	IN const char *contentType;	Type of content | ||||
|  *	IN int contentLength;		length of content | ||||
|  *	IN int timeout;			time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Makes the HTTP POST message, connects to the peer,  | ||||
|  *	sends the HTTP POST request. Adds the post handle to buffer of  | ||||
|  *	such handles | ||||
|  * | ||||
|  * Return : int; | ||||
|  *	UPNP_E_SUCCESS		- On Sucess | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Parameter | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_SOCKET_ERROR | ||||
|  *	UPNP_E_SOCKET_CONNECT | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_OpenHttpPost | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN const char *url_str :		String as a URL	 | ||||
| *		IN OUT void **Handle :			Pointer to buffer to store HTTP | ||||
| *										post handle | ||||
| *		IN const char *contentType :	Type of content | ||||
| *		IN int contentLength :			length of content | ||||
| *		IN int timeout :				time out value | ||||
| * | ||||
| *	Description :	Makes the HTTP POST message, connects to the peer,  | ||||
| *		sends the HTTP POST request. Adds the post handle to buffer of  | ||||
| *		such handles | ||||
| * | ||||
| *	Return : int; | ||||
| *		UPNP_E_SUCCESS - On Sucess ; | ||||
| *		UPNP_E_INVALID_PARAM - Invalid Paramter ; | ||||
| *		UPNP_E_OUTOF_MEMORY ; | ||||
| *		UPNP_E_SOCKET_ERROR ; | ||||
| *		UPNP_E_SOCKET_CONNECT ; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_OpenHttpPost(IN const char *url_str, | ||||
| 		      IN OUT void **Handle, | ||||
| 		      IN const char *contentType, | ||||
| 		      IN int contentLength, | ||||
| 		      IN int timeout); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_ReadHttpGet | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *Handle;		Handle to the HTTP get object | ||||
|  *	IN OUT char *buf;		Buffer to get the read and parsed data | ||||
|  *	IN OUT unsigned int *size;	Size of the buffer passed | ||||
|  *	IN int timeout;			time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Parses already existing data, then gets new data. | ||||
|  *	Parses and extracts information from the new data. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Sucess | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Parameter | ||||
|  *	UPNP_E_BAD_RESPONSE | ||||
|  *	UPNP_E_BAD_HTTPMSG | ||||
|  *	UPNP_E_CANCELED | ||||
|  ************************************************************************/ | ||||
| int http_ReadHttpGet( | ||||
| 	IN void *Handle, | ||||
| *	Function :	http_ReadHttpGet | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN void *Handle :			Handle to the HTTP get object | ||||
| *		IN OUT char *buf :			Buffer to get the read and parsed data | ||||
| *		IN OUT unsigned int *size :	Size of tge buffer passed | ||||
| *		IN int timeout :			time out value | ||||
| * | ||||
| *	Description :	Parses already existing data, then gets new data. | ||||
| *		Parses and extracts information from the new data. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		UPNP_E_SUCCESS - On Sucess ; | ||||
| *		UPNP_E_INVALID_PARAM  - Invalid Parameter; | ||||
| *		UPNP_E_BAD_RESPONSE ; | ||||
| *		UPNP_E_BAD_HTTPMSG ; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_ReadHttpGet(IN void *Handle, | ||||
| 					IN OUT char *buf, | ||||
| 					IN OUT unsigned int *size, | ||||
| 					IN int timeout); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_HttpGetProgress | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *Handle;		Handle to the HTTP get object | ||||
|  *	OUT unsigned int *length;	Buffer to get the read and parsed data | ||||
|  *	OUT unsigned int *total;	Size of tge buffer passed | ||||
|  * | ||||
|  * Description: | ||||
|  *	Extracts information from the Handle to the HTTP get object. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Sucess | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Parameter | ||||
|  ************************************************************************/ | ||||
| int http_HttpGetProgress( | ||||
| 	IN void *Handle, | ||||
| *   Function :  http_HttpGetProgress | ||||
| * | ||||
| *   Parameters : | ||||
| *       IN void *Handle :           Handle to the HTTP get object | ||||
| *       OUT unsigned int *length :  Buffer to get the read and parsed data | ||||
| *       OUT unsigned int *total :   Size of tge buffer passed | ||||
| * | ||||
| *   Description :   Extracts information from the Handle to the HTTP get | ||||
| *                   object. | ||||
| * | ||||
| *   Return : int ; | ||||
| *       UPNP_E_SUCCESS - On Sucess ; | ||||
| *       UPNP_E_INVALID_PARAM  - Invalid Parameter; | ||||
| * | ||||
| *   Note : | ||||
| ************************************************************************/ | ||||
| int http_HttpGetProgress(IN void *Handle, | ||||
| 						OUT unsigned int *length, | ||||
| 						OUT unsigned int *total ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_CloseHttpGet | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *Handle;	Handle to HTTP get object | ||||
|  * | ||||
|  * Description: | ||||
|  *	Clears the handle allocated for the HTTP GET operation | ||||
|  *	Clears socket states and memory allocated for socket operations.  | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Success | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Parameter | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_CloseHttpGet | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN void *Handle ;	Handle to HTTP get object | ||||
| * | ||||
| *	Description :	Clears the handle allocated for the HTTP GET operation | ||||
| *		Clears socket states and memory allocated for socket operations.  | ||||
| * | ||||
| *	Return : int ; | ||||
| *		UPNP_E_SUCCESS - On Success | ||||
| *		UPNP_E_INVALID_PARAM - Invalid Parameter | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_CloseHttpGet(IN void *Handle); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_OpenHttpGet | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char *url_str:		String as a URL | ||||
|  *	IN OUT void **Handle:		Pointer to buffer to store HTTP | ||||
|  *					post handle | ||||
|  *	IN OUT char **contentType:	Type of content | ||||
|  *	OUT int *contentLength:		length of content | ||||
|  *	OUT int *httpStatus:		HTTP status returned on receiving a | ||||
|  *					response message | ||||
|  *	IN int timeout:			time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Makes the HTTP GET message, connects to the peer,  | ||||
|  *	sends the HTTP GET request, gets the response and parses the  | ||||
|  *	response. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Success | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Paramters | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_SOCKET_ERROR | ||||
|  *	UPNP_E_BAD_RESPONSE | ||||
|  ************************************************************************/ | ||||
| int http_OpenHttpGet( | ||||
| 	IN const char *url_str, | ||||
| *	Function :	http_OpenHttpGet | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN const char *url_str :	String as a URL | ||||
| *		IN OUT void **Handle :		Pointer to buffer to store HTTP | ||||
| *									post handle | ||||
| *		IN OUT char **contentType :	Type of content | ||||
| *		OUT int *contentLength :	length of content | ||||
| *		OUT int *httpStatus :		HTTP status returned on receiving a | ||||
| *									response message | ||||
| *		IN int timeout :			time out value | ||||
| * | ||||
| *	Description :	Makes the HTTP GET message, connects to the peer,  | ||||
| *		sends the HTTP GET request, gets the response and parses the  | ||||
| *		response. | ||||
| * | ||||
| *	Return : int; | ||||
| *		UPNP_E_SUCCESS - On Success ; | ||||
| *		UPNP_E_INVALID_PARAM - Invalid Paramters ; | ||||
| *		UPNP_E_OUTOF_MEMORY ; | ||||
| *		UPNP_E_SOCKET_ERROR ; | ||||
| *		UPNP_E_BAD_RESPONSE ; | ||||
| * | ||||
| *	Note : | ||||
| * | ||||
| ************************************************************************/ | ||||
| int http_OpenHttpGet(IN const char *url_str, | ||||
| 					IN OUT void **Handle, | ||||
| 					IN OUT char **contentType, | ||||
| 					OUT int *contentLength, | ||||
| 					OUT int *httpStatus, | ||||
| 					IN int timeout); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_OpenHttpGetProxy | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char *url_str;		String as a URL | ||||
|  *	IN const char *proxy_str;	String as a URL | ||||
|  *	IN OUT void **Handle;		Pointer to buffer to store HTTP | ||||
|  *					post handle | ||||
|  *	IN OUT char **contentType;	Type of content | ||||
|  *	OUT int *contentLength;		length of content | ||||
|  *	OUT int *httpStatus;		HTTP status returned on receiving a | ||||
|  *					response message | ||||
|  *	IN int timeout:			time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Makes the HTTP GET message, connects to the peer,  | ||||
|  *	sends the HTTP GET request, gets the response and parses the response. | ||||
|  *	If a proxy URL is defined then the connection is made there. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Success | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Paramters | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_SOCKET_ERROR | ||||
|  *	UPNP_E_BAD_RESPONSE | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_OpenHttpGetProxy | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN const char *url_str :	String as a URL | ||||
| *		IN const char *proxy_str :	String as a URL to the proxy | ||||
| *		IN OUT void **Handle :		Pointer to buffer to store HTTP | ||||
| *									post handle | ||||
| *		IN OUT char **contentType :	Type of content | ||||
| *		OUT int *contentLength :	length of content | ||||
| *		OUT int *httpStatus :		HTTP status returned on receiving a | ||||
| *									response message | ||||
| *		IN int timeout :			time out value | ||||
| * | ||||
| *	Description :	Makes the HTTP GET message, connects to the peer,  | ||||
| *		sends the HTTP GET request, gets the response and parses the  | ||||
| *		response. | ||||
| * | ||||
| *	Return : int; | ||||
| *		UPNP_E_SUCCESS - On Success ; | ||||
| *		UPNP_E_INVALID_PARAM - Invalid Paramters ; | ||||
| *		UPNP_E_OUTOF_MEMORY ; | ||||
| *		UPNP_E_SOCKET_ERROR ; | ||||
| *		UPNP_E_BAD_RESPONSE ; | ||||
| * | ||||
| *	Note : | ||||
| * | ||||
| ************************************************************************/ | ||||
| int http_OpenHttpGetProxy(IN const char *url_str, | ||||
| 					IN const char *proxy_str, | ||||
| 					IN OUT void **Handle, | ||||
| @@ -444,134 +430,126 @@ int http_OpenHttpGetProxy(IN const char *url_str, | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_SendStatusResponse | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN SOCKINFO *info;		Socket information object | ||||
|  *	IN int http_status_code;	error code returned while making  | ||||
|  *					or sending the response message | ||||
|  *	IN int request_major_version;	request major version | ||||
|  *	IN int request_minor_version;	request minor version | ||||
|  * | ||||
|  * Description: | ||||
|  *	Generate a response message for the status query and send the | ||||
|  *	status response. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	0 -- success | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_SOCKET_WRITE | ||||
|  *	UPNP_E_TIMEDOUT | ||||
|  ************************************************************************/ | ||||
| int http_SendStatusResponse( | ||||
| 	IN SOCKINFO *info, | ||||
| 	IN int http_status_code, | ||||
| *	Function :	http_SendStatusResponse | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN SOCKINFO *info :				Socket information object | ||||
| *		IN int http_status_code :		error code returned while making  | ||||
| *										or sending the response message | ||||
| *		IN int request_major_version :	request major version | ||||
| *		IN int request_minor_version :	request minor version | ||||
| * | ||||
| *	Description :	Generate a response message for the status query and | ||||
| *		send the status response. | ||||
| * | ||||
| *	Return : int; | ||||
| *		0 -- success | ||||
| *		UPNP_E_OUTOF_MEMORY | ||||
| *		UPNP_E_SOCKET_WRITE | ||||
| *		UPNP_E_TIMEDOUT | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_SendStatusResponse( IN SOCKINFO *info, IN int http_status_code, | ||||
| 						  IN int request_major_version, | ||||
| 						  IN int request_minor_version ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_MakeMessage | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	INOUT membuffer* buf;		buffer with the contents of the  | ||||
|  *					message | ||||
|  *	IN int http_major_version;	HTTP major version | ||||
|  *	IN int http_minor_version;	HTTP minor version | ||||
|  *	IN const char* fmt;		Pattern format  | ||||
|  *	...;	 | ||||
|  * | ||||
|  * Description: | ||||
|  *	Generate an HTTP message based on the format that is specified | ||||
|  *	in the input parameters. | ||||
|  * | ||||
|  * fmt types: | ||||
|  *	'B':	arg = int status_code  | ||||
|  *		appends content-length, content-type and HTML body | ||||
|  *		for given code | ||||
|  *	'b':	arg1 = const char* buf; | ||||
|  *		arg2 = size_t buf_length memory ptr | ||||
|  *	'C':	(no args) appends a HTTP CONNECTION: close header  | ||||
|  *			depending on major,minor version | ||||
|  *	'c':	(no args) appends CRLF "\r\n" | ||||
|  *	'D':	(no args) appends HTTP DATE: header | ||||
|  *	'd':	arg = int number            // appends decimal number | ||||
|  *	'G':	arg = range information     // add range header | ||||
|  *	'h':	arg = off_t number          // appends off_t number | ||||
|  *	'K':	(no args)                   // add chunky header | ||||
|  *	'N':	arg1 = off_t content_length // content-length header | ||||
|  *	'q':    arg1 = http_method_t        // request start line and HOST header | ||||
|  *		arg2 = (uri_type *) | ||||
|  *	'Q':	arg1 = http_method_t;       // start line of request | ||||
|  *		arg2 = char* url;  | ||||
|  *		arg3 = size_t url_length  | ||||
|  *	'R':	arg = int status_code       // adds a response start line | ||||
|  *	'S':	(no args) appends HTTP SERVER: header | ||||
|  *	's':	arg = const char* C_string | ||||
|  *	'T':	arg = char * content_type; format | ||||
|  *		e.g: "text/html"; content-type header | ||||
|  *	't':	arg = time_t * gmt_time     // appends time in RFC 1123 fmt | ||||
|  *	'U':	(no args) appends HTTP USER-AGENT: header | ||||
|  *      'X':    arg = const char useragent; "redsonic" HTTP X-User-Agent: useragent | ||||
|  * | ||||
|  * Return: int | ||||
|  *	0 - On Success | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_INVALID_URL | ||||
|  ************************************************************************/ | ||||
| int http_MakeMessage( | ||||
| 	INOUT membuffer* buf,  | ||||
| *	Function :	http_MakeMessage | ||||
| * | ||||
| *	Parameters : | ||||
| *		INOUT membuffer* buf :		buffer with the contents of the  | ||||
| *									message | ||||
| *		IN int http_major_version :	HTTP major version | ||||
| *		IN int http_minor_version :	HTTP minor version | ||||
| *		IN const char* fmt :		Pattern format  | ||||
| *		... :	 | ||||
| * | ||||
| *	Description :	Generate an HTTP message based on the format that is  | ||||
| *		specified in the input parameters. | ||||
| * | ||||
| *		fmt types: | ||||
| *		's':	arg = const char* C_string | ||||
| *		'b':	arg1 = const char* buf; arg2 = size_t buf_length  | ||||
| *				memory ptr | ||||
| *		'c':	(no args) appends CRLF "\r\n" | ||||
| *		'd':	arg = int number		// appends decimal number | ||||
| *		'h':	arg = off_t number		// appends off_t number | ||||
| *		't':	arg = time_t * gmt_time	// appends time in RFC 1123 fmt | ||||
| *		'D':	(no args) appends HTTP DATE: header | ||||
| *		'S':	(no args) appends HTTP SERVER: header | ||||
| *		'U':	(no args) appends HTTP USER-AGENT: header | ||||
| *		'C':	(no args) appends a HTTP CONNECTION: close header  | ||||
| *				depending on major,minor version | ||||
| *		'N':	arg1 = int content_length	// content-length header | ||||
| *		'Q':	arg1 = http_method_t; arg2 = char* url;  | ||||
| *				arg3 = int url_length // start line of request | ||||
| *		'R':	arg = int status_code // adds a response start line | ||||
| *		'B':	arg = int status_code  | ||||
| *				appends content-length, content-type and HTML body for given code | ||||
| *		'T':	arg = char * content_type; format e.g: "text/html";	 | ||||
| *				 content-type header | ||||
| * | ||||
| *	Return : int; | ||||
| *		0 - On Success | ||||
| *		UPNP_E_OUTOF_MEMORY | ||||
| *		UPNP_E_INVALID_URL; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int http_MakeMessage( INOUT membuffer* buf,  | ||||
| 			IN int http_major_version, | ||||
| 			IN int http_minor_version, | ||||
| 			IN const char* fmt, ... ); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_CalcResponseVersion | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN int request_major_vers;	Request major version | ||||
|  *	IN int request_minor_vers;	Request minor version | ||||
|  *	OUT int* response_major_vers;	Response mojor version | ||||
|  *	OUT int* response_minor_vers;	Response minor version | ||||
|  * | ||||
|  * Description: | ||||
|  *	Calculate HTTP response versions based on the request versions. | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_CalcResponseVersion | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN int request_major_vers :		Request major version | ||||
| *		IN int request_minor_vers :		Request minor version | ||||
| *		OUT int* response_major_vers :	Response mojor version | ||||
| *		OUT int* response_minor_vers :	Response minor version | ||||
| * | ||||
| *	Description :	Calculate HTTP response versions based on the request | ||||
| *		versions. | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void http_CalcResponseVersion(  | ||||
| 	IN int request_major_vers, | ||||
| 	IN int request_minor_vers, | ||||
| 	OUT int* response_major_vers, | ||||
| 	OUT int* response_minor_vers ); | ||||
|  | ||||
| 		IN int request_major_vers, IN int request_minor_vers, | ||||
| 		OUT int* response_major_vers, OUT int* response_minor_vers ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: http_OpenHttpGetEx | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN const char *url_str;		String as a URL | ||||
|  *	IN OUT void **Handle;		Pointer to buffer to store HTTP | ||||
|  *					post handle | ||||
|  *	IN OUT char **contentType;	Type of content | ||||
|  *	OUT int *contentLength;		length of content | ||||
|  *	OUT int *httpStatus;		HTTP status returned on receiving a | ||||
|  *					response message | ||||
|  *	IN int timeout;			time out value | ||||
|  * | ||||
|  * Description: | ||||
|  *	Makes the HTTP GET message, connects to the peer,  | ||||
|  *	sends the HTTP GET request, gets the response and parses the  | ||||
|  *	response. | ||||
|  * | ||||
|  * Return: int | ||||
|  *	UPNP_E_SUCCESS		- On Success | ||||
|  *	UPNP_E_INVALID_PARAM	- Invalid Paramters | ||||
|  *	UPNP_E_OUTOF_MEMORY | ||||
|  *	UPNP_E_SOCKET_ERROR | ||||
|  *	UPNP_E_BAD_RESPONSE | ||||
|  ************************************************************************/ | ||||
| *	Function :	http_OpenHttpGetEx | ||||
| * | ||||
| *	Parameters : | ||||
| *		IN const char *url_str :	String as a URL | ||||
| *		IN OUT void **Handle :		Pointer to buffer to store HTTP | ||||
| *									post handle | ||||
| *		IN OUT char **contentType :	Type of content | ||||
| *		OUT int *contentLength :	length of content | ||||
| *		OUT int *httpStatus :		HTTP status returned on receiving a | ||||
| *									response message | ||||
| *		IN int timeout :			time out value | ||||
| * | ||||
| *	Description :	Makes the HTTP GET message, connects to the peer,  | ||||
| *		sends the HTTP GET request, gets the response and parses the  | ||||
| *		response. | ||||
| * | ||||
| *	Return : int; | ||||
| *		UPNP_E_SUCCESS - On Success ; | ||||
| *		UPNP_E_INVALID_PARAM - Invalid Paramters ; | ||||
| *		UPNP_E_OUTOF_MEMORY ; | ||||
| *		UPNP_E_SOCKET_ERROR ; | ||||
| *		UPNP_E_BAD_RESPONSE ; | ||||
| * | ||||
| *	Note : | ||||
| * | ||||
| ************************************************************************/ | ||||
| int http_OpenHttpGetEx(IN const char *url_str, | ||||
| 		     IN OUT void **Handle, | ||||
| 		     IN OUT char **contentType, | ||||
| @@ -581,19 +559,19 @@ int http_OpenHttpGetEx(IN const char *url_str, | ||||
| 			 IN int highRange, | ||||
| 		     IN int timeout); | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: get_sdk_info | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	OUT char *info;	buffer to store the operating system information | ||||
|  * | ||||
|  * Description: | ||||
|  *	Returns the server information for the operating system | ||||
|  * | ||||
|  * Return: | ||||
|  *	UPNP_INLINE void | ||||
|  ************************************************************************/ | ||||
| *	Function :	get_sdk_info | ||||
| * | ||||
| *	Parameters : | ||||
| *		OUT char *info ;	 | ||||
| * | ||||
| *	Description :	Returns the server information for the operating  | ||||
| *		system | ||||
| * | ||||
| *	Return : void ; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void get_sdk_info( OUT char *info ); | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| @@ -602,4 +580,3 @@ void get_sdk_info( OUT char *info ); | ||||
|  | ||||
|  | ||||
| #endif // GENLIB_NET_HTTP_HTTPREADWRITE_H | ||||
|  | ||||
|   | ||||
| @@ -1,150 +1,154 @@ | ||||
| /************************************************************************ | ||||
|  *  | ||||
|  * Copyright (c) 2000-2003 Intel Corporation  | ||||
|  * All rights reserved.  | ||||
|  * | ||||
|  * Redistribution and use in source and binary forms, with or without  | ||||
|  * modification, are permitted provided that the following conditions are met:  | ||||
|  * | ||||
|  * * Redistributions of source code must retain the above copyright notice,  | ||||
|  * this list of conditions and the following disclaimer.  | ||||
|  * * Redistributions in binary form must reproduce the above copyright notice,  | ||||
|  * this list of conditions and the following disclaimer in the documentation  | ||||
|  * and/or other materials provided with the distribution.  | ||||
|  * Neither name of Intel Corporation nor the names of its contributors  | ||||
|  * may be used to endorse or promote products derived from this software  | ||||
|  * without specific prior written permission. | ||||
|  *  | ||||
|  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  | ||||
|  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT  | ||||
|  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  | ||||
|  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR  | ||||
|  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  | ||||
|  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,  | ||||
|  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR  | ||||
|  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY  | ||||
|  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||||
|  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS  | ||||
|  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
|  * | ||||
|  ************************************************************************/ | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
| // | ||||
| // Copyright (c) 2000-2003 Intel Corporation  | ||||
| // All rights reserved.  | ||||
| // | ||||
| // Redistribution and use in source and binary forms, with or without  | ||||
| // modification, are permitted provided that the following conditions are met:  | ||||
| // | ||||
| // * Redistributions of source code must retain the above copyright notice,  | ||||
| // this list of conditions and the following disclaimer.  | ||||
| // * Redistributions in binary form must reproduce the above copyright notice,  | ||||
| // this list of conditions and the following disclaimer in the documentation  | ||||
| // and/or other materials provided with the distribution.  | ||||
| // * Neither name of Intel Corporation nor the names of its contributors  | ||||
| // may be used to endorse or promote products derived from this software  | ||||
| // without specific prior written permission. | ||||
| //  | ||||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  | ||||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT  | ||||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR  | ||||
| // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR  | ||||
| // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  | ||||
| // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,  | ||||
| // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR  | ||||
| // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY  | ||||
| // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||||
| // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS  | ||||
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| // | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| #ifndef MINISERVER_H | ||||
| #define MINISERVER_H | ||||
|  | ||||
|  | ||||
| #include "sock.h" | ||||
| #include "httpparser.h" | ||||
|  | ||||
|  | ||||
| extern SOCKET gMiniServerStopSock; | ||||
|  | ||||
|  | ||||
| typedef struct MServerSockArray { | ||||
| 	/* socket for listening for miniserver requests */ | ||||
| 	int miniServerSock; | ||||
| 	/* socket for stopping miniserver */ | ||||
| 	int miniServerStopSock; | ||||
| 	/* socket for incoming advertisments and search requests */ | ||||
| 	int ssdpSock; | ||||
|   int miniServerSock;     //socket for listening for miniserver | ||||
|                           //requests | ||||
|   int miniServerStopSock; //socket for stopping miniserver  | ||||
|   int ssdpSock; //socket for incoming advertisments and search requests | ||||
|  | ||||
|   int stopPort; | ||||
|   int miniServerPort; | ||||
|  | ||||
| 	/* socket for sending search requests and receiving search replies */ | ||||
| 	CLIENTONLY(int ssdpReqSock;) | ||||
|   CLIENTONLY(int ssdpReqSock;) //socket for sending search  | ||||
|        //requests and receiving | ||||
|        // search replies | ||||
|        | ||||
| } MiniServerSockArray; | ||||
|  | ||||
| //typedef void (*MiniServerCallback) ( const char* document, int sockfd ); | ||||
|  | ||||
| typedef void (*MiniServerCallback)( | ||||
| 	IN http_parser_t *parser, | ||||
| typedef void (*MiniServerCallback) ( IN http_parser_t *parser, | ||||
| 									 IN http_message_t* request,  | ||||
| 									 IN SOCKINFO *info ); | ||||
|  | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
| #endif | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: SetHTTPGetCallback | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerCallback callback; - HTTP Callback to be invoked  | ||||
|  * | ||||
|  * Description:	Set HTTP Get Callback | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	SetHTTPGetCallback | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerCallback callback ; - HTTP Callback to be invoked  | ||||
| * | ||||
| *	Description :	Set HTTP Get Callback | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void SetHTTPGetCallback( MiniServerCallback callback ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: SetSoapCallback | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerCallback callback; - SOAP Callback to be invoked  | ||||
|  * | ||||
|  * Description: Set SOAP Callback | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	SetSoapCallback | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerCallback callback ; - SOAP Callback to be invoked  | ||||
| * | ||||
| *	Description :	Set SOAP Callback | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| #ifdef INCLUDE_DEVICE_APIS | ||||
| void SetSoapCallback( MiniServerCallback callback ); | ||||
| #else  /* INCLUDE_DEVICE_APIS */ | ||||
| #else  | ||||
| static inline void SetSoapCallback( MiniServerCallback callback ) {} | ||||
| #endif /* INCLUDE_DEVICE_APIS */ | ||||
| #endif | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: SetGenaCallback | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	MiniServerCallback callback; - GENA Callback to be invoked | ||||
|  * | ||||
|  * D6escription: Set GENA Callback | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	SetGenaCallback | ||||
| * | ||||
| *	Parameters : | ||||
| *		MiniServerCallback callback ; - GENA Callback to be invoked | ||||
| * | ||||
| *	Description :	Set GENA Callback | ||||
| * | ||||
| *	Return :	void | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void SetGenaCallback( MiniServerCallback callback ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: StartMiniServer | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	unsigned short listen_port ; Port on which the server listens for  | ||||
|  *	incoming connections | ||||
|  * | ||||
|  * Description: Initialize the sockets functionality for the  | ||||
|  *	Miniserver. Initialize a thread pool job to run the MiniServer | ||||
|  *	and the job to the thread pool. If listen port is 0, port is  | ||||
|  *	dynamically picked | ||||
|  * | ||||
|  * 	Use timer mechanism to start the MiniServer, failure to meet the  | ||||
|  *	allowed delay aborts the attempt to launch the MiniServer. | ||||
|  * | ||||
|  * Return: int; | ||||
|  *	Actual port socket is bound to - On Success:  | ||||
|  *	A negative number UPNP_E_XXX - On Error   			 | ||||
|  ************************************************************************/ | ||||
| *	Function :	StartMiniServer | ||||
| * | ||||
| *	Parameters : | ||||
| *		unsigned short listen_port ; Port on which the server listens for  | ||||
| *									incoming connections | ||||
| * | ||||
| *	Description :	Initialize the sockets functionality for the  | ||||
| *		Miniserver. Initialize a thread pool job to run the MiniServer | ||||
| *		and the job to the thread pool. If listen port is 0, port is  | ||||
| *		dynamically picked | ||||
| * | ||||
| *		Use timer mechanism to start the MiniServer, failure to meet the  | ||||
| *		allowed delay aborts the attempt to launch the MiniServer. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		Actual port socket is bound to - On Success:  | ||||
| *		A negative number UPNP_E_XXX - On Error   			 | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int StartMiniServer( unsigned short listen_port ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: StopMiniServer | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	void;	 | ||||
|  * | ||||
|  * Description: Stop and Shutdown the MiniServer and free socket resources. | ||||
|  * | ||||
|  * Return : int; | ||||
|  *	Always returns 0  | ||||
|  ************************************************************************/ | ||||
| int StopMiniServer(); | ||||
| *	Function :	StopMiniServer | ||||
| * | ||||
| *	Parameters : | ||||
| *		void ;	 | ||||
| * | ||||
| *	Description :	Stop and Shutdown the MiniServer and free socket  | ||||
| *		resources. | ||||
| * | ||||
| *	Return : int ; | ||||
| *		Always returns 0  | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| int StopMiniServer( void ); | ||||
|  | ||||
|  | ||||
| #ifdef __cplusplus | ||||
| }   /* extern C */ | ||||
| #endif | ||||
|  | ||||
|  | ||||
| #endif /* MINISERVER_H */ | ||||
|  | ||||
|   | ||||
| @@ -36,8 +36,12 @@ | ||||
|  | ||||
| #include "upnp.h" | ||||
| #include "client_table.h" | ||||
|  | ||||
| //#include "../ssdp/ssdplib.h" | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| #define MAX_INTERFACES 256 | ||||
|  | ||||
| #define DEFAULT_INTERFACE 1 | ||||
| @@ -94,25 +98,18 @@ struct Handle_Info | ||||
|     int   aliasInstalled;       // 0 = not installed; otherwise installed | ||||
| }; | ||||
|  | ||||
| extern ithread_rwlock_t GlobalHndRWLock; | ||||
| extern ithread_mutex_t GlobalHndMutex; | ||||
| Upnp_Handle_Type GetHandleInfo(int Hnd, struct Handle_Info **HndInfo);  | ||||
|  | ||||
| #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 HandleLock()  \ | ||||
| 	UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Trying Lock"); \ | ||||
| 	ithread_mutex_lock(&GlobalHndMutex); \ | ||||
| 	UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "LOCK"); | ||||
|  | ||||
| #define HandleUnlock() \ | ||||
| 	UpnpPrintf(UPNP_INFO, API,__FILE__, __LINE__, "Trying Unlock"); \ | ||||
| 	ithread_rwlock_unlock(&GlobalHndRWLock); \ | ||||
| 	UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlocked rwlock"); | ||||
| 	ithread_mutex_unlock(&GlobalHndMutex); \ | ||||
| 	UpnpPrintf(UPNP_INFO, API, __FILE__, __LINE__, "Unlock"); | ||||
|  | ||||
| Upnp_Handle_Type GetClientHandleInfo(int *client_handle_out,  | ||||
|                                      struct Handle_Info **HndInfo); | ||||
|   | ||||
| @@ -31,22 +31,19 @@ | ||||
|  | ||||
| #ifndef UTIL_H | ||||
| #define UTIL_H | ||||
|  | ||||
|  | ||||
| #include "upnp.h" | ||||
|  | ||||
|  | ||||
| // usually used to specify direction of parameters in functions | ||||
| #ifndef IN | ||||
| 	#define IN | ||||
| #define IN | ||||
| #endif | ||||
|  | ||||
| #ifndef OUT | ||||
| 	#define OUT | ||||
| #define OUT | ||||
| #endif | ||||
|  | ||||
| #ifndef INOUT | ||||
| 	#define INOUT | ||||
| #define INOUT | ||||
| #endif | ||||
|  | ||||
|  | ||||
| @@ -55,18 +52,23 @@ | ||||
| #define EVENT_TERMINATE	-3 | ||||
|  | ||||
|  | ||||
| #ifndef WIN32 | ||||
|  #define max(a, b)   (((a)>(b))? (a):(b)) | ||||
|  #define min(a, b)   (((a)<(b))? (a):(b)) | ||||
| #endif | ||||
|  | ||||
|  | ||||
| // boolean type in C | ||||
| typedef char xboolean; | ||||
|  | ||||
| #ifndef TRUE | ||||
| 	#define TRUE 1 | ||||
| #define TRUE 1 | ||||
| #endif | ||||
|  | ||||
| #ifndef FALSE | ||||
| 	#define FALSE 0 | ||||
| #define FALSE 0 | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /////////////////////////// | ||||
| // funcs | ||||
|  | ||||
| @@ -74,62 +76,58 @@ typedef char xboolean; | ||||
| extern "C" { | ||||
| #endif | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: logerror | ||||
|  * | ||||
|  * Parameters: | ||||
|  * 	IN const char *fmt;	format string | ||||
|  * | ||||
|  * Description: Log an error message. | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| void log_error( IN const char *fmt, ... ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: linecopy | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	OUT char dest[LINE_SIZE];	output buffer | ||||
|  *	IN const char *src;		input buffer | ||||
|  * | ||||
|  * Description: Copy no of bytes spcified by the LINE_SIZE constant,  | ||||
|  *	from the source buffer. Null terminate the destination buffer. | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	linecopy | ||||
| * | ||||
| *	Parameters : | ||||
| *		OUT char dest[LINE_SIZE] ;	output buffer | ||||
| *		IN const char* src ;	input buffer | ||||
| * | ||||
| *	Description : Copy no of bytes spcified by the LINE_SIZE constant,  | ||||
| *		from the source buffer. Null terminate the destination buffer | ||||
| * | ||||
| *	Return : void ; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void linecopy( OUT char dest[LINE_SIZE], IN const char* src ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function: namecopy | ||||
|  * | ||||
|  * Parameters: | ||||
|  * 	OUT char dest[NAME_SIZE];	output buffer | ||||
|  * 	IN const char *src;		input buffer | ||||
|  * | ||||
|  * Description: Copy no of bytes spcified by the NAME_SIZE constant,  | ||||
|  * 	from the source buffer. Null terminate the destination buffer | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	namecopy | ||||
| * | ||||
| *	Parameters : | ||||
| *		OUT char dest[NAME_SIZE] ;	output buffer | ||||
| *		IN const char* src ;	input buffer | ||||
| * | ||||
| *	Description : Copy no of bytes spcified by the NAME_SIZE constant,  | ||||
| *		from the source buffer. Null terminate the destination buffer | ||||
| * | ||||
| *	Return : void ; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void namecopy( OUT char dest[NAME_SIZE], IN const char* src ); | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function:	linecopylen | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	OUT char dest[LINE_SIZE];	output buffer | ||||
|  *	IN const char *src;		input buffer | ||||
|  *	IN size_t srclen;		bytes to be copied. | ||||
|  * | ||||
|  * Description : Determine if the srclen passed in paramter is less than  | ||||
|  *	the permitted LINE_SIZE. If it is use the passed parameter, if not | ||||
|  *	use the permitted LINE_SIZE as the length parameter | ||||
|  *	Copy no of bytes spcified by the LINE_SIZE constant,  | ||||
|  *	from the source buffer. Null terminate the destination buffer | ||||
|  * | ||||
|  * Return: void | ||||
|  ************************************************************************/ | ||||
| *	Function :	linecopylen | ||||
| * | ||||
| *	Parameters : | ||||
| *		OUT char dest[LINE_SIZE] ;	output buffer | ||||
| *		IN const char* src ;	input buffer | ||||
| *		IN size_t srclen ;	bytes to be copied. | ||||
| * | ||||
| *	Description : Determine if the srclen passed in paramter is less than  | ||||
| *		the permitted LINE_SIZE. If it is use the passed parameter, if not | ||||
| *		use the permitted LINE_SIZE as the length parameter | ||||
| *		Copy no of bytes spcified by the LINE_SIZE constant,  | ||||
| *		from the source buffer. Null terminate the destination buffer | ||||
| * | ||||
| *	Return : void ; | ||||
| * | ||||
| *	Note : | ||||
| ************************************************************************/ | ||||
| void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen ); | ||||
|  | ||||
|  | ||||
| @@ -137,9 +135,6 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen | ||||
| } // extern C | ||||
| #endif | ||||
|  | ||||
| /* Size of the errorBuffer variable, passed to the strerror_r() function */ | ||||
| #define ERROR_BUFFER_LEN 256 | ||||
|  | ||||
| ////////////////////////////////// | ||||
| // C specific | ||||
| #ifndef __cplusplus | ||||
| @@ -160,14 +155,9 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen | ||||
|  | ||||
| 	#define sleep(a) Sleep((a)*1000) | ||||
| 	#define usleep(a) Sleep((a)/1000) | ||||
|  | ||||
| 	#define strerror_r(a,b,c)	(strerror_s((b),(c),(a))) | ||||
| #else | ||||
| 	#define max(a, b)   (((a)>(b))? (a):(b)) | ||||
| 	#define min(a, b)   (((a)<(b))? (a):(b)) | ||||
| #endif /* WIN32 */ | ||||
| #endif | ||||
|  | ||||
| #endif // __cplusplus | ||||
|  | ||||
| #endif /* UTIL_H */ | ||||
| #endif /* GENLIB_UTIL_UTIL_H */ | ||||
|  | ||||
|   | ||||
| @@ -126,18 +126,18 @@ int web_server_set_alias( IN const char* alias_name, | ||||
| int web_server_set_root_dir( IN const char* root_dir ); | ||||
|  | ||||
| /************************************************************************ | ||||
| * Function: web_server_callback	 | ||||
| * | ||||
| * Parameters: | ||||
| *	IN http_parser_t *parser, | ||||
| *	INOUT http_message_t* req, | ||||
| *	IN SOCKINFO *info | ||||
| * | ||||
| * Description: main entry point into web server; | ||||
| *	handles HTTP GET and HEAD requests | ||||
| * | ||||
| * Returns: | ||||
| *	void | ||||
| * Function: web_server_callback											* | ||||
| *																		* | ||||
| * Parameters:															* | ||||
| *	IN http_parser_t *parser,											* | ||||
| *	INOUT http_message_t* req,											* | ||||
| *	IN SOCKINFO *info													* | ||||
| *																		* | ||||
| * Description: main entry point into web server;						* | ||||
| *	handles HTTP GET and HEAD requests									* | ||||
| *																		* | ||||
| * Returns:																* | ||||
| *	void																* | ||||
| ************************************************************************/ | ||||
| void web_server_callback( IN http_parser_t *parser, IN http_message_t* req, INOUT SOCKINFO *info ); | ||||
|  | ||||
| @@ -148,4 +148,3 @@ void web_server_callback( IN http_parser_t *parser, IN http_message_t* req, INOU | ||||
|  | ||||
|  | ||||
| #endif // GENLIB_NET_HTTP_WEBSERVER_H | ||||
|  | ||||
|   | ||||
| @@ -443,9 +443,9 @@ check_soap_body( IN IXML_Document * doc, | ||||
|             if( actionNode ) { | ||||
|                 ns = ixmlNode_getNamespaceURI( actionNode ); | ||||
|                 name = ixmlNode_getLocalName( actionNode ); | ||||
|                 if (name && ns && | ||||
|                     !strcmp( actionName, name ) && | ||||
|                     !strcmp( urn, ns ) ) { | ||||
|  | ||||
|                 if( ( !strcmp( actionName, name ) ) | ||||
|                     && ( !strcmp( urn, ns ) ) ) { | ||||
|                     ret_code = UPNP_E_SUCCESS; | ||||
|                 } | ||||
|             } | ||||
| @@ -607,7 +607,7 @@ get_device_info( IN http_message_t * request, | ||||
|     save_char = control_url[request->uri.pathquery.size]; | ||||
|     ((char *)control_url)[request->uri.pathquery.size] = '\0'; | ||||
|  | ||||
|     HandleLock(); | ||||
|     HandleLock(  ); | ||||
|  | ||||
|     if( GetDeviceHandleInfo( &device_hnd, &device_info ) != HND_DEVICE ) { | ||||
|         goto error_handler; | ||||
| @@ -663,7 +663,7 @@ get_device_info( IN http_message_t * request, | ||||
|  | ||||
|   error_handler: | ||||
|     ((char *)control_url)[request->uri.pathquery.size] = save_char;   // restore | ||||
|     HandleUnlock(); | ||||
|     HandleUnlock(  ); | ||||
|     return ret_code; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -48,8 +48,10 @@ | ||||
| #ifdef WIN32 | ||||
|  #include <ws2tcpip.h> | ||||
|  #include <winsock2.h> | ||||
| 	#include <string.h> | ||||
| #endif /* WIN32 */ | ||||
|  #ifndef imillisleep | ||||
|  #define imillisleep Sleep | ||||
|  #endif | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /************************************************************************ | ||||
| @@ -123,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 | ||||
|  | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|  | ||||
|     if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
| @@ -363,13 +365,8 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg, | ||||
| * Returns: void | ||||
| * | ||||
| ***************************************************************************/ | ||||
| #ifndef WIN32 | ||||
| #warning There are currently no uses of the function 'process_reply()' in the code. | ||||
| #warning 'process_reply()' is a candidate for removal. | ||||
| #else | ||||
| #pragma message("There are currently no uses of the function 'process_reply()' in the code.") | ||||
| #pragma message("'process_reply()' is a candidate for removal.") | ||||
| #endif | ||||
| static UPNP_INLINE void | ||||
| process_reply( IN char *request_buf, | ||||
|                IN int buf_len, | ||||
| @@ -517,10 +514,8 @@ SearchByTarget( IN int Mx, | ||||
|                 IN char *St, | ||||
|                 IN void *Cookie ) | ||||
| { | ||||
|     char errorBuffer[ERROR_BUFFER_LEN]; | ||||
|     int socklen = sizeof( struct sockaddr_in ); | ||||
|     int *id = NULL; | ||||
|     int ret = 0; | ||||
|     char *ReqBuf; | ||||
|     struct sockaddr_in destAddr; | ||||
|     fd_set wrSet; | ||||
| @@ -539,12 +534,12 @@ SearchByTarget( IN int Mx, | ||||
|         return UPNP_E_INVALID_PARAM; | ||||
|     } | ||||
|  | ||||
|     ReqBuf = (char *)malloc( BUFSIZE ); | ||||
|     if( ReqBuf == NULL ) { | ||||
|     ReqBuf = ( char * )malloc( BUFSIZE ); | ||||
|     if( ReqBuf == NULL ) | ||||
|         return UPNP_E_OUTOF_MEMORY; | ||||
|     } | ||||
|  | ||||
|     UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__, ">>> SSDP SEND >>>\n"); | ||||
|     UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|         ">>> SSDP SEND >>>\n%s\n", ReqBuf ); | ||||
|  | ||||
|     timeTillRead = Mx; | ||||
|  | ||||
| @@ -564,7 +559,7 @@ SearchByTarget( IN int Mx, | ||||
|     FD_ZERO( &wrSet ); | ||||
|     FD_SET( gSsdpReqSocket, &wrSet ); | ||||
|  | ||||
|     // add search criteria to list | ||||
|     //add search criteria to list | ||||
|     HandleLock(); | ||||
|     if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) { | ||||
|         HandleUnlock(); | ||||
| @@ -582,7 +577,7 @@ SearchByTarget( IN int Mx, | ||||
|     TPJobSetPriority( &job, MED_PRIORITY ); | ||||
|     TPJobSetFreeFunction( &job, ( free_routine ) free ); | ||||
|  | ||||
|     // Schedule a timeout event to remove search Arg | ||||
|     //Schdule a timeout event to remove search Arg | ||||
|     TimerThreadSchedule( &gTimerThread, timeTillRead, | ||||
|                          REL_SEC, &job, SHORT_TERM, id ); | ||||
|     newArg->timeoutEventId = ( *id ); | ||||
| @@ -590,25 +585,37 @@ SearchByTarget( IN int Mx, | ||||
|     ListAddTail( &ctrlpt_info->SsdpSearchList, newArg ); | ||||
|     HandleUnlock(); | ||||
|  | ||||
|     ret = setsockopt( gSsdpReqSocket, IPPROTO_IP, IP_MULTICAST_IF, | ||||
|         (char *)&addr, sizeof (addr) ); | ||||
|     setsockopt( gSsdpReqSocket, IPPROTO_IP, IP_MULTICAST_IF, | ||||
|                 ( char * )&addr, sizeof( addr ) ); | ||||
|  | ||||
|     ret = select( gSsdpReqSocket + 1, NULL, &wrSet, NULL, NULL ); | ||||
|     if( ret == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|     if( select( gSsdpReqSocket + 1, NULL, &wrSet, NULL, NULL ) | ||||
|         == UPNP_SOCKETERROR ) { | ||||
|         if( errno == EBADF ) { | ||||
|             UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|             "SSDP_LIB: Error in select(): %s\n", | ||||
|             errorBuffer ); | ||||
|                 "SSDP_LIB :RequestHandler:An invalid file descriptor" | ||||
|                 " was givenin one of the sets. \n" ); | ||||
|         } else if( errno == EINTR ) { | ||||
|             UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|                 "SSDP_LIB :RequestHandler:  A non blocked " | ||||
|                 "signal was caught.    \n" ); | ||||
|         } else if( errno == EINVAL ) { | ||||
|             UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|                 "SSDP_LIB :RequestHandler: n is negative.  \n" ); | ||||
|         } else if( errno == ENOMEM ) { | ||||
|             UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|                 "SSDP_LIB : RequestHandler:select was unable to " | ||||
|                 "allocate memory for internal tables.\n" ); | ||||
|         } | ||||
| 	shutdown( gSsdpReqSocket, SD_BOTH ); | ||||
|         UpnpCloseSocket( gSsdpReqSocket ); | ||||
|         free( ReqBuf ); | ||||
|  | ||||
|         return UPNP_E_INTERNAL_ERROR; | ||||
|     } else if( FD_ISSET( gSsdpReqSocket, &wrSet ) ) { | ||||
|         int NumCopy = 0; | ||||
|  | ||||
|         while( NumCopy < NUM_SSDP_COPY ) { | ||||
|             sendto( gSsdpReqSocket, ReqBuf, strlen( ReqBuf ), 0, | ||||
|                 (struct sockaddr *)&destAddr, socklen ); | ||||
|                     ( struct sockaddr * )&destAddr, socklen ); | ||||
|             NumCopy++; | ||||
|             imillisleep( SSDP_PAUSE ); | ||||
|         } | ||||
| @@ -620,4 +627,3 @@ SearchByTarget( IN int Mx, | ||||
|  | ||||
| #endif // EXCLUDE_SSDP | ||||
| #endif // INCLUDE_CLIENT_APIS | ||||
|  | ||||
|   | ||||
| @@ -30,14 +30,10 @@ | ||||
| /////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| #include "config.h" | ||||
|  | ||||
| #ifdef INCLUDE_DEVICE_APIS | ||||
| #if EXCLUDE_SSDP == 0 | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "ssdplib.h" | ||||
| #include "upnpapi.h" | ||||
| #include "ThreadPool.h" | ||||
| @@ -49,7 +45,7 @@ | ||||
| #ifdef WIN32 | ||||
| 	#include <ws2tcpip.h> | ||||
| 	#include <winsock2.h> | ||||
| #endif /* WIN32 */ | ||||
| #endif | ||||
|  | ||||
| #define MSGTYPE_SHUTDOWN	0 | ||||
| #define MSGTYPE_ADVERTISEMENT	1 | ||||
| @@ -217,28 +213,26 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr, | ||||
|                    IN int NumPacket, | ||||
|                    IN char **RqPacket ) | ||||
| { | ||||
|     char errorBuffer[ERROR_BUFFER_LEN]; | ||||
|     int ReplySock; | ||||
|     int socklen = sizeof( struct sockaddr_in ); | ||||
|     int NumCopy; | ||||
|     int Index; | ||||
|     int ReplySock, | ||||
|       socklen = sizeof( struct sockaddr_in ); | ||||
|     int NumCopy, | ||||
|       Index; | ||||
|     unsigned long replyAddr = inet_addr( LOCAL_HOST ); | ||||
|     int ttl = 4; // a/c to UPNP Spec | ||||
|     int ttl = 4;                //a/c to UPNP Spec | ||||
|  | ||||
|     ReplySock = socket( AF_INET, SOCK_DGRAM, 0 ); | ||||
|     if ( ReplySock == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|     if( ReplySock == UPNP_INVALID_SOCKET ) { | ||||
|         UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|             "SSDP_LIB: New Request Handler:" | ||||
|             "Error in socket(): %s\n", errorBuffer ); | ||||
|             "Error in socket operation !!!\n" ); | ||||
|  | ||||
|         return UPNP_E_OUTOF_SOCKET; | ||||
|     } | ||||
|  | ||||
|     setsockopt( ReplySock, IPPROTO_IP, IP_MULTICAST_IF, | ||||
|         (char *)&replyAddr, sizeof (replyAddr) ); | ||||
|                 ( char * )&replyAddr, sizeof( replyAddr ) ); | ||||
|     setsockopt( ReplySock, IPPROTO_IP, IP_MULTICAST_TTL, | ||||
|         (char *)&ttl, sizeof (int) ); | ||||
|                 ( char * )&ttl, sizeof( int ) ); | ||||
|  | ||||
|     for( Index = 0; Index < NumPacket; Index++ ) { | ||||
|         int rc; | ||||
| @@ -248,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  | ||||
|         //  request." | ||||
|         //  reuqest." | ||||
|         //   | ||||
|         // http://www.upnp.org/download/draft-goland-http-udp-04.txt | ||||
|         // | ||||
| @@ -268,7 +262,6 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr, | ||||
|  | ||||
|     shutdown( ReplySock, SD_BOTH ); | ||||
|     UpnpCloseSocket( ReplySock ); | ||||
|  | ||||
|     return UPNP_E_SUCCESS; | ||||
| } | ||||
|  | ||||
| @@ -341,8 +334,8 @@ CreateServicePacket( IN int msg_type, | ||||
|         ret_code = http_MakeMessage( | ||||
|             &buf, 1, 1, | ||||
|             "Q" "sssdc" "sdc" "ssc" "ssc" "ssc" "S" "Xc" "sscc", | ||||
|             HTTPMETHOD_NOTIFY, "*", (size_t)1, | ||||
|             "HOST: ", SSDP_IP, ":", SSDP_PORT, | ||||
|             HTTPMETHOD_NOTIFY, "*", | ||||
|             1, "HOST: ", SSDP_IP, ":", SSDP_PORT, | ||||
|             "CACHE-CONTROL: max-age=", duration, | ||||
|             "LOCATION: ", location, | ||||
|             "NT: ", nt, | ||||
| @@ -537,6 +530,7 @@ 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. | ||||
| @@ -613,9 +607,11 @@ 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 | ||||
| @@ -660,9 +656,11 @@ 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 | ||||
| @@ -702,6 +700,7 @@ 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. | ||||
| @@ -822,4 +821,3 @@ DeviceShutdown( IN char *DevType, | ||||
|  | ||||
| #endif // EXCLUDE_SSDP | ||||
| #endif // INCLUDE_DEVICE_APIS | ||||
|  | ||||
|   | ||||
| @@ -43,7 +43,6 @@ | ||||
| #include "httpreadwrite.h" | ||||
|  | ||||
| #ifdef WIN32 | ||||
| 	#include <string.h> | ||||
|  #include <winsock2.h> | ||||
|  #include <ws2tcpip.h> | ||||
|  #include "unixutil.h" | ||||
| @@ -51,47 +50,47 @@ | ||||
|  | ||||
| #define MAX_TIME_TOREAD  45 | ||||
|  | ||||
| CLIENTONLY( SOCKET gSsdpReqSocket = 0; ) | ||||
| CLIENTONLY( SOCKET gSsdpReqSocket = 0; | ||||
|      ) | ||||
|  | ||||
| void RequestHandler(); | ||||
| Event ErrotEvt; | ||||
|      void RequestHandler(  ); | ||||
|      Event ErrotEvt; | ||||
|  | ||||
| enum Listener { Idle, Stopping, Running }; | ||||
|      enum Listener { Idle, Stopping, Running }; | ||||
|  | ||||
| unsigned short ssdpStopPort; | ||||
|      unsigned short ssdpStopPort; | ||||
|  | ||||
| struct SSDPSockArray { | ||||
| 	// socket for incoming advertisments and search requests | ||||
| 	int ssdpSock; | ||||
| 	// socket for sending search requests and receiving search replies | ||||
| 	CLIENTONLY( int ssdpReqSock; ) | ||||
| }; | ||||
|      struct SSDPSockArray { | ||||
|          int ssdpSock;          //socket for incoming advertisments and search requests | ||||
|            CLIENTONLY( int ssdpReqSock; | ||||
|               )                 //socket for sending search  | ||||
|              //requests and receiving | ||||
|              // search replies | ||||
|      }; | ||||
|  | ||||
| #ifdef INCLUDE_DEVICE_APIS | ||||
| #if EXCLUDE_SSDP == 0 | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : AdvertiseAndReply | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	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 | ||||
|  *   IN char *DeviceType:Device type | ||||
|  *	IN char *DeviceUDN:Device UDN | ||||
|  *   IN char *ServiceType:Service type | ||||
|  *	IN int Exp:Advertisement age | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function sends SSDP advertisements, replies and shutdown messages. | ||||
|  * | ||||
|  * Returns: int | ||||
|  *	UPNP_E_SUCCESS if successful else appropriate error | ||||
|  ***************************************************************************/ | ||||
| * Function : AdvertiseAndReply									 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	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 | ||||
| *   IN char *DeviceType:Device type | ||||
| *	IN char *DeviceUDN:Device UDN | ||||
| *   IN char *ServiceType:Service type | ||||
| *	IN int Exp:Advertisement age | ||||
| * | ||||
| * Description:														 | ||||
| *	This function sends SSDP advertisements, replies and shutdown messages. | ||||
| * | ||||
| * Returns: int | ||||
| *	UPNP_E_SUCCESS if successful else appropriate error | ||||
| ***************************************************************************/ | ||||
| int AdvertiseAndReply( IN int AdFlag, | ||||
|                        IN UpnpDevice_Handle Hnd, | ||||
|                        IN enum SsdpSearchType SearchType, | ||||
| @@ -121,14 +120,18 @@ int AdvertiseAndReply( IN int AdFlag, | ||||
|         "Inside AdvertiseAndReply with AdFlag = %d\n", | ||||
|         AdFlag ); | ||||
|  | ||||
|     // Use a read lock | ||||
|     HandleReadLock(); | ||||
|     HandleLock(); | ||||
|     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 | ||||
|  | ||||
|     get_sdk_info( SERVER ); | ||||
| @@ -148,12 +151,14 @@ int AdvertiseAndReply( IN int AdFlag, | ||||
|  | ||||
|         dbgStr = ixmlNode_getNodeName( tmpNode ); | ||||
|                  UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, | ||||
|             "Extracting device type once for %s\n", dbgStr ); | ||||
|                      "Extracting device type once for %s\n", | ||||
|                      dbgStr ); | ||||
|             // extract device type  | ||||
|             ixmlNodeList_free( nodeList ); | ||||
|         nodeList = NULL; | ||||
|         nodeList = ixmlElement_getElementsByTagName( | ||||
|             ( IXML_Element * ) tmpNode, "deviceType" ); | ||||
|         nodeList = | ||||
|             ixmlElement_getElementsByTagName( ( IXML_Element * ) tmpNode, | ||||
|                                               "deviceType" ); | ||||
|         if( nodeList == NULL ) { | ||||
|             continue; | ||||
|         } | ||||
| @@ -161,6 +166,7 @@ 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" ); | ||||
|  | ||||
| @@ -235,7 +241,8 @@ int AdvertiseAndReply( IN int AdFlag, | ||||
|             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 ); | ||||
|             } | ||||
| @@ -317,9 +324,8 @@ 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; | ||||
| @@ -361,21 +367,26 @@ int AdvertiseAndReply( IN int AdFlag, | ||||
|             } else { | ||||
|                 switch ( SearchType ) { | ||||
|                     case SSDP_ALL: | ||||
|                         { | ||||
|                             ServiceReply( DestAddr, servType, | ||||
|                                           UDNstr, SInfo->DescURL, | ||||
|                                           defaultExp ); | ||||
|                             break; | ||||
|                         } | ||||
|                     case SSDP_SERVICE: | ||||
|                         { | ||||
|                             if( ServiceType != NULL ) { | ||||
|                                 if( !strncasecmp( ServiceType, | ||||
|                                                   servType, | ||||
|                                               strlen( ServiceType ) ) ) { | ||||
|                                                   strlen( ServiceType ) ) ) | ||||
|                                 { | ||||
|                                     ServiceReply( DestAddr, servType, | ||||
|                                                   UDNstr, SInfo->DescURL, | ||||
|                                                   defaultExp ); | ||||
|                                 } | ||||
|                             } | ||||
|                             break; | ||||
|                         } | ||||
|                     default: | ||||
|                         break; | ||||
|                 }               // switch(SearchType)                | ||||
| @@ -390,27 +401,27 @@ int AdvertiseAndReply( IN int AdFlag, | ||||
|     UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, | ||||
|         "Exiting AdvertiseAndReply : \n" ); | ||||
|  | ||||
|     HandleUnlock(); | ||||
|     HandleUnlock(  ); | ||||
|  | ||||
|     return UPNP_E_SUCCESS; | ||||
|  | ||||
| }  /****************** End of AdvertiseAndReply *********************/ | ||||
|  | ||||
| #endif /* EXCLUDE_SSDP == 0 */ | ||||
| #endif /* INCLUDE_DEVICE_APIS */ | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : Make_Socket_NoBlocking | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN int sock: socket | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function makes socket non-blocking. | ||||
|  * | ||||
|  * Returns: int | ||||
|  *	0 if successful else -1  | ||||
|  ***************************************************************************/ | ||||
| * Function : Make_Socket_NoBlocking									 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN int sock: socket  | ||||
| * | ||||
| * Description:														 | ||||
| *	This function makes socket non-blocking. | ||||
| * | ||||
| * Returns: int | ||||
| *	0 if successful else -1  | ||||
| ***************************************************************************/ | ||||
| int | ||||
| Make_Socket_NoBlocking( int sock ) | ||||
| { | ||||
| @@ -429,32 +440,34 @@ Make_Socket_NoBlocking( int sock ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : unique_service_name | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char *cmd: Service Name string | ||||
|  *	OUT SsdpEvent *Evt: The SSDP event structure partially filled | ||||
|  *		by all the function. | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function fills the fields of the event structure like DeviceType, | ||||
|  *	Device UDN and Service Type | ||||
|  * | ||||
|  * Returns: int | ||||
|  *	0 if successful else -1 | ||||
|  ***************************************************************************/ | ||||
| int unique_service_name(IN char *cmd, IN SsdpEvent *Evt) | ||||
| * Function : unique_service_name								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN char *cmd: Service Name string  | ||||
| *	OUT SsdpEvent *Evt: The SSDP event structure partially filled  | ||||
| *						by all the function. | ||||
| * | ||||
| * Description:														 | ||||
| *	This function fills the fields of the event structure like DeviceType, | ||||
| *	Device UDN and Service Type | ||||
| * | ||||
| * Returns: int | ||||
| *	0 if successful else -1  | ||||
| ***************************************************************************/ | ||||
| int | ||||
| unique_service_name( IN char *cmd, | ||||
|                      IN SsdpEvent * Evt ) | ||||
| { | ||||
|     char TempBuf[COMMAND_LEN]; | ||||
|     char *TempPtr = NULL; | ||||
|     char *Ptr = NULL; | ||||
|     char *ptr1 = NULL; | ||||
|     char *ptr2 = NULL; | ||||
|     char *ptr3 = NULL; | ||||
|     char *TempPtr, | ||||
|       TempBuf[COMMAND_LEN], | ||||
|      *Ptr, | ||||
|      *ptr1, | ||||
|      *ptr2, | ||||
|      *ptr3; | ||||
|     int CommandFound = 0; | ||||
|     int length = 0; | ||||
|  | ||||
|     if( ( TempPtr = strstr( cmd, "uuid:schemas" ) ) != NULL ) { | ||||
|  | ||||
|         ptr1 = strstr( cmd, ":device" ); | ||||
|         if( ptr1 != NULL ) { | ||||
|             ptr2 = strstr( ptr1 + 1, ":" ); | ||||
| @@ -486,6 +499,7 @@ int unique_service_name(IN char *cmd, IN SsdpEvent *Evt) | ||||
|     } | ||||
|  | ||||
|     if( ( TempPtr = strstr( cmd, "uuid" ) ) != NULL ) { | ||||
|         //printf("cmd = %s\n",cmd); | ||||
|         if( ( Ptr = strstr( cmd, "::" ) ) != NULL ) { | ||||
|             strncpy( Evt->UDN, TempPtr, Ptr - TempPtr ); | ||||
|             Evt->UDN[Ptr - TempPtr] = '\0'; | ||||
| @@ -497,6 +511,7 @@ int unique_service_name(IN char *cmd, IN SsdpEvent *Evt) | ||||
|  | ||||
|     if( strstr( cmd, "urn:" ) != NULL | ||||
|         && strstr( cmd, ":service:" ) != NULL ) { | ||||
|  | ||||
|         if( ( TempPtr = strstr( cmd, "urn" ) ) != NULL ) { | ||||
|             strcpy( Evt->ServiceType, TempPtr ); | ||||
|             CommandFound = 1; | ||||
| @@ -511,17 +526,8 @@ int unique_service_name(IN char *cmd, IN SsdpEvent *Evt) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if( ( TempPtr = strstr( cmd, "::upnp:rootdevice" ) ) != NULL ) { | ||||
|         /* Everything before "::upnp::rootdevice" is the UDN. */ | ||||
|         if( TempPtr != cmd ) { | ||||
|             length = TempPtr - cmd; | ||||
|             strncpy(Evt->UDN, cmd, length); | ||||
|             Evt->UDN[length] = 0; | ||||
|             CommandFound = 1; | ||||
|         } | ||||
|     } | ||||
|     | ||||
|     if( CommandFound == 0 ) { | ||||
|  | ||||
|         return -1; | ||||
|     } | ||||
|  | ||||
| @@ -529,18 +535,18 @@ int unique_service_name(IN char *cmd, IN SsdpEvent *Evt) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : ssdp_request_type1 | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char *cmd: command came in the ssdp request | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function figures out the type of the SSDP search in the | ||||
|  *	in the request. | ||||
|  * | ||||
|  * Returns: enum SsdpSearchType | ||||
|  *	return appropriate search type else returns SSDP_ERROR | ||||
|  ***************************************************************************/ | ||||
| * Function : ssdp_request_type1								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN char *cmd: command came in the ssdp request | ||||
| * | ||||
| * Description:														 | ||||
| *	This function figures out the type of the SSDP search in the  | ||||
| *	in the request. | ||||
| * | ||||
| * Returns: enum SsdpSearchType | ||||
| *	return appropriate search type else returns SSDP_ERROR | ||||
| ***************************************************************************/ | ||||
| enum SsdpSearchType | ||||
| ssdp_request_type1( IN char *cmd ) | ||||
| { | ||||
| @@ -565,20 +571,20 @@ ssdp_request_type1( IN char *cmd ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : ssdp_request_type | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN char *cmd: command came in the ssdp request | ||||
|  *	OUT SsdpEvent *Evt: The event structure partially filled by | ||||
|  *		 this function. | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function starts filling the SSDP event structure based upon the  | ||||
|  *	request received. | ||||
|  * | ||||
|  * Returns: int | ||||
|  *	0 on success; -1 on error | ||||
|  ***************************************************************************/ | ||||
| * Function : ssdp_request_type								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN char *cmd: command came in the ssdp request | ||||
| *	OUT SsdpEvent *Evt: The event structure partially filled by | ||||
| *		 this function. | ||||
| * | ||||
| * Description:														 | ||||
| *	This function starts filling the SSDP event structure based upon the  | ||||
| *	request received.  | ||||
| * | ||||
| * Returns: int | ||||
| *	0 on success; -1 on error | ||||
| ***************************************************************************/ | ||||
| int | ||||
| ssdp_request_type( IN char *cmd, | ||||
|                    OUT SsdpEvent * Evt ) | ||||
| @@ -596,18 +602,18 @@ ssdp_request_type( IN char *cmd, | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : free_ssdp_event_handler_data | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
|  *			SSDP request message. | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function frees the ssdp request | ||||
|  * | ||||
|  * Returns: VOID | ||||
|  * | ||||
|  ***************************************************************************/ | ||||
| * Function : free_ssdp_event_handler_data								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
| *			SSDP request message. | ||||
| * | ||||
| * Description:														 | ||||
| *	This function frees the ssdp request | ||||
| * | ||||
| * Returns: VOID | ||||
| *	 | ||||
| ***************************************************************************/ | ||||
| static void | ||||
| free_ssdp_event_handler_data( void *the_data ) | ||||
| { | ||||
| @@ -623,18 +629,18 @@ free_ssdp_event_handler_data( void *the_data ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : valid_ssdp_msg | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
|  *			SSDP request message. | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function do some quick checking of the ssdp msg | ||||
|  * | ||||
|  * Returns: xboolean | ||||
|  *	returns TRUE if msg is valid else FALSE | ||||
|  ***************************************************************************/ | ||||
| * Function : valid_ssdp_msg								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
| *			SSDP request message. | ||||
| * | ||||
| * Description:														 | ||||
| *	This function do some quick checking of the ssdp msg | ||||
| * | ||||
| * Returns: xboolean | ||||
| *	returns TRUE if msg is valid else FALSE | ||||
| ***************************************************************************/ | ||||
| static UPNP_INLINE xboolean | ||||
| valid_ssdp_msg( IN http_message_t * hmsg ) | ||||
| { | ||||
| @@ -664,19 +670,19 @@ valid_ssdp_msg( IN http_message_t * hmsg ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : start_event_handler | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
|  *			SSDP request message. | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function parses the message and dispatches it to a handler | ||||
|  *	which handles the ssdp request msg | ||||
|  * | ||||
|  * Returns: int | ||||
|  *	0 if successful -1 if error | ||||
|  ***************************************************************************/ | ||||
| * Function : start_event_handler								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
| *			SSDP request message. | ||||
| * | ||||
| * Description:														 | ||||
| *	This function parses the message and dispatches it to a handler  | ||||
| *	which handles the ssdp request msg | ||||
| * | ||||
| * Returns: int | ||||
| *	0 if successful -1 if error | ||||
| ***************************************************************************/ | ||||
| static UPNP_INLINE int | ||||
| start_event_handler( void *Data ) | ||||
| { | ||||
| @@ -716,18 +722,18 @@ start_event_handler( void *Data ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : ssdp_event_handler_thread | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
|  *			SSDP request message. | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function is a thread that handles SSDP requests. | ||||
|  * | ||||
|  * Returns: void | ||||
|  * | ||||
|  ***************************************************************************/ | ||||
| * Function : ssdp_event_handler_thread								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN void *the_data: ssdp_thread_data structure. This structure contains | ||||
| *			SSDP request message. | ||||
| * | ||||
| * Description:														 | ||||
| *	This function is a thread that handles SSDP requests. | ||||
| * | ||||
| * Returns: void | ||||
| *	 | ||||
| ***************************************************************************/ | ||||
| static void | ||||
| ssdp_event_handler_thread( void *the_data ) | ||||
| { | ||||
| @@ -740,7 +746,8 @@ ssdp_event_handler_thread( void *the_data ) | ||||
|     // send msg to device or ctrlpt | ||||
|     if( ( hmsg->method == HTTPMETHOD_NOTIFY ) || | ||||
|         ( hmsg->request_method == HTTPMETHOD_MSEARCH ) ) { | ||||
|         CLIENTONLY( ssdp_handle_ctrlpt_msg( hmsg, &data->dest_addr, FALSE, NULL );) | ||||
|         CLIENTONLY( ssdp_handle_ctrlpt_msg( hmsg, &data->dest_addr, | ||||
|                                             FALSE, NULL );); | ||||
|     } else { | ||||
|         ssdp_handle_device_request( hmsg, &data->dest_addr ); | ||||
|     } | ||||
| @@ -750,17 +757,17 @@ ssdp_event_handler_thread( void *the_data ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : readFromSSDPSocket | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	IN SOCKET socket: SSDP socket | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function reads the data from the ssdp socket. | ||||
|  * | ||||
|  * Returns: void | ||||
|  * | ||||
|  ***************************************************************************/ | ||||
| * Function : readFromSSDPSocket								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	IN SOCKET socket: SSDP socket | ||||
| * | ||||
| * Description:														 | ||||
| *	This function reads the data from the ssdp socket. | ||||
| * | ||||
| * Returns: void | ||||
| *	 | ||||
| ***************************************************************************/ | ||||
| void | ||||
| readFromSSDPSocket( SOCKET socket ) | ||||
| { | ||||
| @@ -812,20 +819,18 @@ readFromSSDPSocket( SOCKET socket ) | ||||
|                              ( struct sockaddr * )&clientAddr, &socklen ); | ||||
|  | ||||
|     if( byteReceived > 0 ) { | ||||
|  | ||||
|         requestBuf[byteReceived] = '\0'; | ||||
|         UpnpPrintf( UPNP_INFO, SSDP, | ||||
|                              __FILE__, __LINE__, | ||||
|             "Start of received response ----------------------------------------------------\n" | ||||
|             "%s\n" | ||||
|             "End of received response ------------------------------------------------------\n" | ||||
|             "From host %s\n", | ||||
|                              "Received response !!!  " | ||||
|                              "%s From host %s \n", | ||||
|                              requestBuf, | ||||
|                              inet_ntoa( clientAddr.sin_addr ) ); | ||||
|  | ||||
|         UpnpPrintf( UPNP_PACKET, SSDP, __FILE__, __LINE__, | ||||
|             "Start of received multicast packet --------------------------------------------\n" | ||||
|             "%s\n" | ||||
|             "End of received multicast packet ----------------------------------------------\n", | ||||
|             requestBuf ); | ||||
|             "Received multicast packet:" | ||||
|             "\n %s\n", requestBuf ); | ||||
|         //add thread pool job to handle request | ||||
|         if( data != NULL ) { | ||||
|             data->parser.msg.msg.length += byteReceived; | ||||
| @@ -847,164 +852,146 @@ readFromSSDPSocket( SOCKET socket ) | ||||
| } | ||||
|  | ||||
| /************************************************************************ | ||||
|  * Function : get_ssdp_sockets								 | ||||
|  * | ||||
|  * Parameters: | ||||
|  *	OUT MiniServerSockArray *out: Arrays of SSDP sockets | ||||
|  * | ||||
|  * Description: | ||||
|  *	This function creates the ssdp sockets. It set their option to listen | ||||
|  *	for multicast traffic. | ||||
|  * | ||||
|  * Returns: int | ||||
|  *	return UPNP_E_SUCCESS if successful else returns appropriate error | ||||
|  ***************************************************************************/ | ||||
| * Function : get_ssdp_sockets								 | ||||
| *																	 | ||||
| * Parameters:														 | ||||
| *	OUT MiniServerSockArray *out: Arrays of SSDP sockets | ||||
| * | ||||
| * Description:														 | ||||
| *	This function creates the ssdp sockets. It set their option to listen  | ||||
| *	for multicast traffic. | ||||
| * | ||||
| * Returns: int | ||||
| *	return UPNP_E_SUCCESS if successful else returns appropriate error | ||||
| ***************************************************************************/ | ||||
| int | ||||
| get_ssdp_sockets( MiniServerSockArray * out ) | ||||
| { | ||||
|     char errorBuffer[ERROR_BUFFER_LEN]; | ||||
|     SOCKET ssdpSock; | ||||
|  | ||||
|     CLIENTONLY( SOCKET ssdpReqSock; | ||||
|          ) | ||||
|     int onOff = 1; | ||||
|     u_char ttl = 4; | ||||
|     struct ip_mreq ssdpMcastAddr; | ||||
|     struct sockaddr_in ssdpAddr; | ||||
|     int option = 1; | ||||
|     int ret = 0; | ||||
|     struct in_addr addr; | ||||
|     SOCKET ssdpSock; | ||||
| #if INCLUDE_CLIENT_APIS | ||||
|     SOCKET ssdpReqSock; | ||||
|  | ||||
|     ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ); | ||||
|     if ( ssdpReqSock == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in socket(): %s\n", errorBuffer ); | ||||
|  | ||||
|             return UPNP_E_OUTOF_SOCKET; | ||||
|     } | ||||
|     ret = setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, | ||||
|         &ttl, sizeof (ttl) ); | ||||
|     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; | ||||
| #endif /* INCLUDE_CLIENT_APIS */ | ||||
|  | ||||
|     ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 ); | ||||
|     if ( ssdpSock == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in socket(): %s\n", errorBuffer ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) | ||||
|                 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 ) ); | ||||
|             return UPNP_E_OUTOF_SOCKET; | ||||
|         } | ||||
|  | ||||
|     onOff = 1; | ||||
|     ret = setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR, | ||||
|         (char *)&onOff, sizeof(onOff) ); | ||||
|     if ( ret == -1) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in setsockopt() SO_REUSEADDR: %s\n", errorBuffer ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) | ||||
|     if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR, | ||||
|                     ( char * )&onOff, sizeof( onOff ) ) != 0 ) { | ||||
|  | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             SSDP, __FILE__, __LINE__, | ||||
|             "Error in set reuse addr !!!\n" ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) ); | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) ); | ||||
|         shutdown( ssdpSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( ssdpSock ); | ||||
|  | ||||
|         return UPNP_E_SOCKET_ERROR; | ||||
|     } | ||||
|      | ||||
| #if defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__) | ||||
|     ret = setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT, | ||||
|         (char *)&onOff, sizeof (onOff) ); | ||||
|     if ( ret == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in setsockopt() SO_REUSEPORT: %s\n", errorBuffer ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) | ||||
|     #ifdef __FreeBSD__ | ||||
|     if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT, | ||||
|                     ( char * )&onOff, sizeof( onOff ) ) != 0 ) { | ||||
|  | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             SSDP, __FILE__, __LINE__, | ||||
|             "Error in set reuse port !!!\n" ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) ); | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) ); | ||||
|         shutdown( ssdpSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( ssdpSock ); | ||||
|  | ||||
|         return UPNP_E_SOCKET_ERROR; | ||||
|     } | ||||
| #endif /* __FreeBSD__ */ | ||||
|     #endif | ||||
|  | ||||
|     memset( (void *)&ssdpAddr, 0, sizeof( struct sockaddr_in ) ); | ||||
|     memset( ( void * )&ssdpAddr, 0, sizeof( struct sockaddr_in ) ); | ||||
|     ssdpAddr.sin_family = AF_INET; | ||||
|     //  ssdpAddr.sin_addr.s_addr = inet_addr(LOCAL_HOST); | ||||
|     ssdpAddr.sin_addr.s_addr = htonl( INADDR_ANY ); | ||||
|     ssdpAddr.sin_port = htons( SSDP_PORT ); | ||||
|     ret = bind( ssdpSock, (struct sockaddr *)&ssdpAddr, sizeof (ssdpAddr) ); | ||||
|     if ( ret == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in bind(), addr=0x%08X, port=%d: %s\n", | ||||
|             INADDR_ANY, SSDP_PORT, errorBuffer ); | ||||
|     if( bind | ||||
|         ( ssdpSock, ( struct sockaddr * )&ssdpAddr, | ||||
|           sizeof( ssdpAddr ) ) != 0 ) { | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             SSDP, __FILE__, __LINE__, | ||||
|             "Error in binding !!!\n" ); | ||||
|             shutdown( ssdpSock, SD_BOTH ); | ||||
|         UpnpCloseSocket( ssdpSock ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) | ||||
|  | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) ); | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) ); | ||||
|         return UPNP_E_SOCKET_BIND; | ||||
|     } | ||||
|  | ||||
|     memset( (void *)&ssdpMcastAddr, 0, sizeof (struct ip_mreq) ); | ||||
|     memset( ( void * )&ssdpMcastAddr, 0, sizeof( struct ip_mreq ) ); | ||||
|     ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST ); | ||||
|     ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP ); | ||||
|     ret = setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, | ||||
|         (char *)&ssdpMcastAddr, sizeof (struct ip_mreq) ); | ||||
|     if ( ret == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in setsockopt() IP_ADD_MEMBERSHIP (join multicast group): %s\n", | ||||
|             errorBuffer ); | ||||
|     if( setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, | ||||
|                     ( char * )&ssdpMcastAddr, | ||||
|                     sizeof( struct ip_mreq ) ) != 0 ) { | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             SSDP, __FILE__, __LINE__, | ||||
|             "Error in joining" " multicast group !!!\n" ); | ||||
|         shutdown( ssdpSock, SD_BOTH ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) ); | ||||
|         UpnpCloseSocket( ssdpSock ); | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) | ||||
|  | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) ); | ||||
|         return UPNP_E_SOCKET_ERROR; | ||||
|     } | ||||
|  | ||||
|     /* Set multicast interface. */ | ||||
|     memset( (void *)&addr, 0, sizeof (struct in_addr) ); | ||||
|     memset( ( void * )&addr, 0, sizeof( struct in_addr )); | ||||
|     addr.s_addr = inet_addr(LOCAL_HOST); | ||||
|     ret = setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF, | ||||
|         (char *)&addr, sizeof addr); | ||||
|     if ( ret == -1 ) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|     if (setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF, | ||||
|                    (char *)&addr, sizeof addr) != 0) { | ||||
|         UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, | ||||
|             "Error in setsockopt() IP_MULTICAST_IF (set multicast interface): %s\n", | ||||
|             errorBuffer ); | ||||
|             "Couldn't set multicast interface.\n" ); | ||||
|         /* This is probably not a critical error, so let's continue. */ | ||||
|     } | ||||
|  | ||||
|     /* result is not checked becuase it will fail in WinMe and Win9x. */ | ||||
|     ret = setsockopt( ssdpSock, IPPROTO_IP, | ||||
|         IP_MULTICAST_TTL, &ttl, sizeof (ttl) ); | ||||
|  | ||||
|     ret = setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST, | ||||
|         (char *)&option, sizeof (option) ); | ||||
|     if( ret == -1) { | ||||
|         strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); | ||||
|         UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, | ||||
|             "Error in setsockopt() SO_BROADCAST (set broadcast): %s\n", | ||||
|             errorBuffer ); | ||||
|     // result is not checked becuase it will fail in WinMe and Win9x. | ||||
|     setsockopt( ssdpSock, IPPROTO_IP, | ||||
|                 IP_MULTICAST_TTL, &ttl, sizeof( ttl ) ); | ||||
|     if( setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST, | ||||
|                     ( char * )&option, sizeof( option ) ) != 0 ) { | ||||
|         UpnpPrintf( UPNP_CRITICAL, | ||||
|             SSDP, __FILE__, __LINE__, | ||||
|             "Error in setting broadcast !!!\n" ); | ||||
|         shutdown( ssdpSock, SD_BOTH ); | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) | ||||
|         CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ) ); | ||||
|         UpnpCloseSocket( ssdpSock ); | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) | ||||
|  | ||||
|         CLIENTONLY( UpnpCloseSocket( ssdpReqSock ) ); | ||||
|         return UPNP_E_NETWORK_ERROR; | ||||
|     } | ||||
|  | ||||
|     CLIENTONLY( out->ssdpReqSock = ssdpReqSock; ) | ||||
|     CLIENTONLY( out->ssdpReqSock = ssdpReqSock; | ||||
|          ); | ||||
|     out->ssdpSock = ssdpSock; | ||||
|  | ||||
|     return UPNP_E_SUCCESS; | ||||
| } | ||||
|  | ||||
| #endif /* EXCLUDE_SSDP */ | ||||
|  | ||||
| #endif // EXCLUDE_SSDP | ||||
|   | ||||
| @@ -50,11 +50,22 @@ | ||||
| #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, | ||||
| @@ -107,10 +118,14 @@ static unsigned char PADDING[64] = { | ||||
|    MD5 initialization. Begins an MD5 operation, writing a new context.  | ||||
|  */ | ||||
| void | ||||
| MD5Init(MD5_CTX * context) | ||||
| MD5Init( context ) | ||||
|      MD5_CTX *context;          /* 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; | ||||
| @@ -124,72 +139,114 @@ MD5Init(MD5_CTX * context) | ||||
|  */ | ||||
|  | ||||
| void | ||||
| MD5Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen) | ||||
| MD5Update( context, | ||||
|            input, | ||||
|            inputLen ) | ||||
|      MD5_CTX *context;          /* context */ | ||||
|      unsigned char *input;      /* input block */ | ||||
|      unsigned int inputLen;     /* length of input block */ | ||||
| { | ||||
| 	unsigned int i; | ||||
| 	unsigned int index; | ||||
| 	unsigned int partLen; | ||||
|     unsigned int i, | ||||
|       index, | ||||
|       partLen; | ||||
|  | ||||
| 	/* Compute number of bytes mod 64 */ | ||||
| 	index = (unsigned int)((context->count[0] >> 3) & 0x3F); | ||||
|     /* | ||||
|        Compute number of bytes mod 64  | ||||
|      */ | ||||
|     index = ( unsigned int )( ( context->count[0] >> 3 ) & 0x3F ); | ||||
|  | ||||
| 	/* Update number of bits */ | ||||
| 	if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) { | ||||
|     /* | ||||
|        Update number of bits  | ||||
|      */ | ||||
|     if( ( context->count[0] += | ||||
|           ( ( UINT4 ) inputLen << 3 ) ) < ( ( UINT4 ) inputLen << 3 ) ) | ||||
|         context->count[1]++; | ||||
| 	} | ||||
| 	context->count[1] += ((UINT4)inputLen >> 29); | ||||
|  | ||||
|     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; | ||||
| 	} | ||||
|     /* | ||||
|        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 ); | ||||
|  | ||||
| 	/* 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(unsigned char digest[16], MD5_CTX *context) | ||||
| MD5Final( digest, | ||||
|           context ) | ||||
|      unsigned char digest[16];  /* message digest */ | ||||
|      MD5_CTX *context;          /* context */ | ||||
| { | ||||
|  | ||||
|     unsigned char bits[8]; | ||||
|     unsigned int index; | ||||
|     unsigned int padLen; | ||||
|     unsigned int index, | ||||
|       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); | ||||
|     padLen = (index < 56) ? (56 - index) : (120 - index); | ||||
|     MD5Update(context, PADDING, padLen); | ||||
|     /* | ||||
|        Pad out to 56 mod 64. | ||||
|      */ | ||||
|     index = ( unsigned int )( ( context->count[0] >> 3 ) & 0x3f ); | ||||
|  | ||||
|     /* Append length (before padding) */ | ||||
|     MD5Update(context, bits, 8); | ||||
|     padLen = ( index < 56 ) ? ( 56 - index ) : ( 120 - index ); | ||||
|  | ||||
|     /* Store state in digest */ | ||||
|     Encode(digest, context->state, 16); | ||||
|     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 ) ); | ||||
|  | ||||
|     /* Zeroize sensitive information. */ | ||||
|     MD5_memset((POINTER)context, 0, sizeof(*context)); | ||||
| } | ||||
|  | ||||
| /* | ||||
|    MD5 basic transformation. Transforms state based on block.  | ||||
|  */ | ||||
| static void | ||||
| MD5Transform(UINT4 state[4], unsigned char block[64]) | ||||
| MD5Transform( state, | ||||
|               block ) | ||||
|      UINT4 state[4]; | ||||
|      unsigned char block[64]; | ||||
| { | ||||
|     UINT4 a = state[0], | ||||
|       b = state[1], | ||||
| @@ -296,16 +353,23 @@ MD5Transform(UINT4 state[4], unsigned char block[64]) | ||||
|    a multiple of 4. | ||||
|  */ | ||||
| static void | ||||
| Encode(unsigned char *output, UINT4 *input, unsigned int len) | ||||
| Encode( output, | ||||
|         input, | ||||
|         len ) | ||||
|      unsigned char *output; | ||||
|      UINT4 *input; | ||||
|      unsigned int len; | ||||
| { | ||||
| 	unsigned int i; | ||||
| 	unsigned int 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); | ||||
|     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 ); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| /* | ||||
| @@ -314,40 +378,55 @@ Encode(unsigned char *output, UINT4 *input, unsigned int len) | ||||
|  */ | ||||
|  | ||||
| static void | ||||
| Decode(UINT4 *output, unsigned char *input, unsigned int len) | ||||
| Decode( output, | ||||
|         input, | ||||
|         len ) | ||||
|      UINT4 *output; | ||||
|      unsigned char *input; | ||||
|      unsigned int len; | ||||
| { | ||||
| 	unsigned int i; | ||||
| 	unsigned int j; | ||||
| 	for (i = 0, j = 0; j < len; ++i, j += 4) { | ||||
|     unsigned int i, | ||||
|       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); | ||||
| 	} | ||||
|             ( ( UINT4 ) input[j] ) | ( ( ( UINT4 ) input[j + 1] ) << 8 ) | | ||||
|             ( ( ( UINT4 ) input[j + 2] ) << 16 ) | | ||||
|             ( ( ( UINT4 ) input[j + 3] ) << 24 ); | ||||
| } | ||||
|  | ||||
| /* | ||||
|    Note: Replace for loop with standard memcpy if possible. | ||||
|    Note: Replace "for loop" with standard memcpy if possible. | ||||
|  */ | ||||
| static void | ||||
| MD5_memcpy(POINTER  output, POINTER  input, unsigned int len) | ||||
| MD5_memcpy( output, | ||||
|             input, | ||||
|             len ) | ||||
|      POINTER output; | ||||
|      POINTER input; | ||||
|      unsigned int len; | ||||
| { | ||||
|     unsigned int i; | ||||
| 	for (i = 0; i < len; ++i) { | ||||
|  | ||||
|     for( i = 0; i < len; i++ ) | ||||
|         output[i] = input[i]; | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
| /* | ||||
|    Note: Replace for loop with standard memset if possible. | ||||
|    Note: Replace "for loop" with standard memset if possible. | ||||
|  */ | ||||
| static void | ||||
| MD5_memset(POINTER output, int value, unsigned int len) | ||||
| MD5_memset( output, | ||||
|             value, | ||||
|             len ) | ||||
|      POINTER output; | ||||
|      int value; | ||||
|      unsigned int len; | ||||
| { | ||||
|     unsigned int i; | ||||
| 	for (i = 0; i < len; ++i) { | ||||
| 		((char *)output)[i] = (char)value; | ||||
| 	} | ||||
| } | ||||
|  | ||||
|     for( i = 0; i < len; i++ ) | ||||
|         ( ( char * )output )[i] = ( char )value; | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -18,11 +18,11 @@ | ||||
|  */ | ||||
|  | ||||
| #include "config.h" | ||||
| #ifdef WIN32 | ||||
| 	#include <winsock2.h> | ||||
| #else /* WIN32 */ | ||||
| #ifndef WIN32 | ||||
|  #include <unistd.h> | ||||
| #endif /* WIN32 */ | ||||
| #else | ||||
|  #include <winsock2.h> | ||||
| #endif | ||||
| #include <string.h> | ||||
| #include <stdio.h> | ||||
| #include "sysdep.h" | ||||
| @@ -33,16 +33,17 @@ | ||||
|    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; | ||||
|     }; | ||||
|  | ||||
| @@ -56,7 +57,7 @@ get_ieee_node_identifier(uuid_node_t *node) | ||||
|    less than 100ns. | ||||
|  */ | ||||
|  | ||||
| #ifdef WIN32 | ||||
| #ifdef _WINDOWS_ | ||||
|  | ||||
| void | ||||
| get_system_time( uuid_time_t * uuid_time ) | ||||
| @@ -82,7 +83,7 @@ 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 { | ||||
| @@ -96,34 +97,38 @@ get_random_info(char seed[16]) | ||||
|     } randomness; | ||||
|     randomness r; | ||||
|  | ||||
| 	/* Initialize memory area so that valgrind does not complain */ | ||||
| 	memset(&r, 0, sizeof r); | ||||
|  | ||||
| 	/* memory usage stats */ | ||||
|     MD5Init( &c ); | ||||
|     /* | ||||
|        memory usage stats  | ||||
|      */ | ||||
|     GlobalMemoryStatus( &r.m ); | ||||
| 	/* random system stats */ | ||||
|     /* | ||||
|        random system stats  | ||||
|      */ | ||||
|     GetSystemInfo( &r.s ); | ||||
| 	/* 100ns resolution (nominally) time of day */ | ||||
|     /* | ||||
|        100ns resolution (nominally) time of day  | ||||
|      */ | ||||
|     GetSystemTimeAsFileTime( &r.t ); | ||||
| 	/* high resolution performance counter */ | ||||
|     /* | ||||
|        high resolution performance counter  | ||||
|      */ | ||||
|     QueryPerformanceCounter( &r.pc ); | ||||
| 	/* milliseconds since last boot */ | ||||
| 	r.tc = GetTickCount(); | ||||
|     /* | ||||
|        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); | ||||
|     MD5Update( &c, &r, sizeof( randomness ) ); | ||||
|     MD5Final( seed, &c ); | ||||
| }; | ||||
|  | ||||
| #else /* WIN32 */ | ||||
| #else | ||||
|  | ||||
| /*-----------------------------------------------------------------------------*/ | ||||
| void | ||||
| get_system_time(uuid_time_t *uuid_time) | ||||
| get_system_time( uuid_time_t * uuid_time ) | ||||
| { | ||||
|     struct timeval tp; | ||||
|  | ||||
| @@ -140,28 +145,22 @@ 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 sysinfo s; | ||||
|         struct timeval t; | ||||
|         char hostname[257]; | ||||
|     } randomness; | ||||
|     randomness r; | ||||
|  | ||||
| 	/* Initialize memory area so that valgrind does not complain */ | ||||
| 	memset(&r, 0, sizeof r); | ||||
|     MD5Init( &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); | ||||
|     gettimeofday( &r.t, ( struct timezone * )0 ); | ||||
|     gethostname( r.hostname, 256 ); | ||||
|     MD5Update( &c, &r, sizeof( randomness ) ); | ||||
|     MD5Final( seed, &c ); | ||||
| }; | ||||
|  | ||||
| #endif /* WIN32 */ | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -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; | ||||
|     uuid_time_t last_time; | ||||
|     uuid_time_t timestamp, | ||||
|       last_time; | ||||
|     unsigned16 clockseq; | ||||
|     uuid_node_t node; | ||||
|     uuid_node_t last_node; | ||||
| @@ -65,64 +65,61 @@ uuid_create(uuid_upnp *uid) | ||||
|     /* | ||||
|        acquire system wide lock so we're alone  | ||||
|      */ | ||||
|     UUIDLock(); | ||||
|     UUIDLock(  ); | ||||
|  | ||||
|     /* | ||||
|        get current time  | ||||
|      */ | ||||
|     get_current_time(×tamp); | ||||
|     get_current_time( ×tamp ); | ||||
|  | ||||
|     /* | ||||
|        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, | ||||
|  | ||||
|     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]); | ||||
|              ( 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'; | ||||
|  | ||||
| }; | ||||
|  | ||||
| /*-----------------------------------------------------------------------------*/ | ||||
| @@ -140,10 +137,11 @@ 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; | ||||
| @@ -229,6 +227,7 @@ 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; | ||||
|     }; | ||||
| @@ -282,7 +281,7 @@ true_random( void ) | ||||
|         inited = 1; | ||||
|     }; | ||||
|  | ||||
|     return ( rand() ); | ||||
|     return ( rand(  ) ); | ||||
| } | ||||
|  | ||||
| /*-----------------------------------------------------------------------------*/ | ||||
|   | ||||
| @@ -105,7 +105,7 @@ main (int argc, char* argv[]) | ||||
| 	 * Test library initialisation | ||||
| 	 */ | ||||
| 	printf ("\n"); | ||||
| 	printf ("Initializing UPnP ... \n"); | ||||
| 	printf ("Intializing UPnP ... \n"); | ||||
| 	rc = UpnpInit (NULL, 0); | ||||
| 	if ( UPNP_E_SUCCESS == rc ) { | ||||
| 		const char* ip_address = UpnpGetServerIpAddress(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user