Commit Graph

510 Commits

Author SHA1 Message Date
Nick Leverton
ef7bbc4866 Summary: upnptools.h should #include upnpconfig.h - ID: 3426326 2011-10-20 12:27:55 +01:00
Fabrice Fontaine
5cf603dcab Bug Fix on M-SEARCH.
Do not answer to M-SEARCH using HTTP version 1.0 as specified by the
UPnP Device Architecture.
(cherry picked from commit 6c6fb3707f)
2011-07-20 06:24:21 -03:00
Iain Denniston
259bed7787 Fixes for compilation under Windows (specifically MSVC). Also added MSVC supported "_inline", and fixed some WIN32 specific warnings.
(cherry picked from commit 92ea719804)
2011-04-02 23:50:36 -03:00
Iain Denniston
7392697aec Several fixes to correctly use SOCKET (and related) types instead of non-portable variations.
(cherry picked from commit fed316ff3e)
2011-04-02 23:50:25 -03:00
Marcelo Roberto Jimenez
583e90cdbc Silence compiler warning message.
warning: unused parameter ‘listen_port6’
(cherry picked from commit e16cb4b225)
2011-03-15 18:58:57 -03:00
Fabrice Fontaine
babfc0ac60 Putting ssdpReqSocks under compilation flag.
Putting all access to ssdpReqSock4 and ssdpReqSock6 under
INCLUDE_CLIENT_APIS compilation flag to be able to compile when
client part of library is disable.
(cherry picked from commit 0996d23318)
2011-03-15 18:58:51 -03:00
Fabrice Fontaine
daec6a0321 New UpnpRegisterRootDevice4 for legacy CPs.
Add a new UpnpRegisterRootDevice4 which allow user to specify a
description URL to be returned for legacy CPs (for example, CPs
searching for a v1 when the device is v2). Most of those CPs does not
work if they found a v2 in the XML description, so this new function is
only used to solve interoperability issues.
(cherry picked from commit 11f9a2bafe)
2011-03-15 18:19:59 -03:00
Iain Denniston
fed2e4f8e5 Partial fix for UpnpGetIfInfo with MSVC
(cherry picked from commit 7338411c08)
2011-03-11 17:59:39 -03:00
Marcelo Roberto Jimenez
a3683a3be0 Created the macros PRIzd and PRIzx to deal with MSVC lack of C99.
Thanks to Iain Denniston for pointing it out.
(cherry picked from commit 3a9ae348bc)
2011-03-11 17:21:18 -03:00
Iain Denniston
a1d7727903 Fixes for headers when compiled under C++
(cherry picked from commit 840669b253)
2011-03-11 16:11:19 -03:00
Marcelo Roberto Jimenez
1df5609d52 Fix for uuid_unpack incorrect shift precedence. 2011-03-10 16:26:11 -03:00
Marcelo Roberto Jimenez
b6baca8eb0 Remove PrintThreadPoolStats() from the public API.
This function uses a ThreadPool object as an argument, which is not
supposed to be exported. Also, debug compilation was broken.
(cherry picked from commit 32e510b45a)
2011-02-07 22:43:40 -02:00
Fabrice Fontaine
28f4d398d8 Major bug fix in IPv6 code.
Major bug fix in miniserver.c for IPv6, bug was introduced when
changing implementation of get_port in November 20th 2010 ("gena:fix
several compiler warnings" commit).
(cherry picked from commit 063d472f80)
2011-02-07 21:28:08 -02:00
Marcelo Roberto Jimenez
2da8a7fba1 White spaces and indentation. 2011-01-30 09:46:51 -02:00
Chandra Penke
40239ca44a Fix for compilation errors
Fix for compilation warnings of unused variables in upnpdebug.c in
release builds.
(cherry picked from commit 6c125feea0)
2011-01-30 09:43:00 -02:00
Chandra Penke
56ab9ba913 Fix for typo in strndup() function definition.
(cherry picked from commit f46683fd0e)
2011-01-17 09:04:51 -02:00
Chandra Penke
1a574ed6cf Fix for large file definitions, FileInfo.h must include upnpconfig.h 2011-01-17 08:55:57 -02:00
Chandra Penke
bf30519f6c Fix for warnings in Apple systems 2011-01-17 08:18:32 -02:00
Marcelo Roberto Jimenez
bdb3f880b7 Define _FILE_OFFSET_BITS, _LARGEFILE_SOURCE and _LARGE_FILE_SOURCE in upnpconfig.h.
Make these definitions available to programs using the library.
Thanks to Chandra Penke for pointing the problem.
(cherry picked from commit abfa841318)
2011-01-16 22:39:37 -02:00
Chandra Penke
03c3c0913f Allow virtual callbacks to use chunked encoding by setting the file length of a UpnpFileInfo object to be UPNP_USING_CHUNKED. 2011-01-16 21:21:47 -02:00
Marcelo Roberto Jimenez
348bf19412 Use config.h to test for the availability of strndup() and strnlen().
(cherry picked from commit 541679d651)
2011-01-16 21:06:00 -02:00
Marcelo Roberto Jimenez
60c9e95637 Fix for UpnpFileInfo_get_LastModified() in http_MakeMessage().
UpnpFileInfo_get_LastModified() returns time_t, and http_MakeMessage()
takes a "time_t *". Thanks to Chandra Penke for pointing the bug.
2011-01-16 15:09:01 -02:00
Chandra Penke
1e2172819d Fixes chunked transfer encoding in HTTP client API
(cherry picked from commit cb1188d2bc)
2011-01-15 21:14:00 -02:00
Marcelo Roberto Jimenez
6333504d45 Null termination of strndup() implementation on systems missing it.
Also, implementation of strnlen() on systems missing it.
(cherry picked from commit 189ce59dbe)
2011-01-14 22:06:26 -02:00
Marcelo Roberto Jimenez
1232119540 Doxygen on membuffer.
(cherry picked from commit 4815e52586)
2011-01-14 10:28:29 -02:00
Marcelo Roberto Jimenez
9d667685ec Minor change in membuffer.c to include "membuffer.h"
...without looking in the standard header path. This allows pupnp
to build in xcode.
(cherry picked from commit 9051731a93)
2011-01-14 10:28:23 -02:00
Marcelo Roberto Jimenez
82207a3e92 Leave just one call to gmtime() in http_MakeMessage().
(cherry picked from commit 39fd869db8)
2011-01-02 22:37:25 -02:00
Marcelo Roberto Jimenez
8190adb3b9 Make sure va_end() is called in http_MakeMessage().
(cherry picked from commit 8997e7fff6)
2011-01-02 22:37:18 -02:00
Marcelo Roberto Jimenez
7ec5511a8d Fixes many problems in sample code.
In particular, undoes 25c908c558:
SF Patch Tracker [ 2836704 ] Search for nested serviceList (not
stopping at the first lis
Submitted By: zephyrus ( zephyrus00jp )

The original zephyrus' code is still #ifdef'd in the file, if someone
wishes to fix it, check for "#ifdef OLD_FIND_SERVICE_CODE".
(cherry picked from commit 7e8d1787c9)
2010-12-23 22:23:51 -02:00
Marcelo Roberto Jimenez
d4ef92e1bd Simplify code in SampleUtil_GetFirstDocumentItem().
(cherry picked from commit 70d2a7c9e7)
2010-12-23 22:17:52 -02:00
Marcelo Roberto Jimenez
3bf350cceb Doxygen and white spaces in samples. 2010-12-22 11:59:24 -02:00
Marcelo Roberto Jimenez
e07ba67188 Remove unnecessary inclusion of param.h.
(cherry picked from commit 4b0c8d52b8)
2010-12-22 11:56:38 -02:00
Marcelo Roberto Jimenez
e91e4bea0f Fix for segfault in sample code.
(cherry picked from commit c05bbec6ec)
2010-12-22 11:56:31 -02:00
Marcelo Roberto Jimenez
0679697ffd White spaces and some debugging information.
(cherry picked from commit c8af5ec806)
2010-12-22 10:00:32 -02:00
Marcelo Roberto Jimenez
3ec9b0c015 Ivan Romanov's system file inclusion patch for WIN32 (mingw).
(cherry picked from commit 1ee8cd9e1a)
2010-12-21 08:35:43 -02:00
Marcelo Roberto Jimenez
270160b644 Missed this inline in ssdplib.h.
(cherry picked from commit a0ebf23785)
2010-12-19 22:57:44 -02:00
Marcelo Roberto Jimenez
5ef17de780 Remove unused enum SsdpCmdType and unused typedef Event.
(cherry picked from commit cdf35baa34)
2010-12-19 22:55:41 -02:00
Marcelo Roberto Jimenez
408d65ecc8 White spaces.
(cherry picked from commit 6af93e6ca6)
2010-12-19 21:20:29 -02:00
Marcelo Roberto Jimenez
66bdf6effb Less include file mess and doxygenation. 2010-12-19 20:00:56 -02:00
Marcelo Roberto Jimenez
d6f1b5de59 Doxygenation of SSDP library. 2010-12-19 19:57:04 -02:00
Marcelo Roberto Jimenez
6d7b3e65f8 Doxygen. 2010-12-19 19:18:43 -02:00
Marcelo Roberto Jimenez
3ad98ad746 SF Tracker: Patches - Fedora mingw32 compilation - ID: 3138849
Details:
Hello. I trying compile libupnp-1.6.10 on the Fedora 14 MinGW
Environment and get many errors. I create patch to fix it. With this
patch i can get static library. This patch is very raw.

Submitted: Ivan Romanov (ivanromanov) - 2010-12-16 23:29:19 UTC
(cherry picked from commit b2a88aa70b)
2010-12-19 19:10:44 -02:00
Marcelo Roberto Jimenez
82738e3ea5 Get rid of useless integer typedefs.
Remove unsigned32, unsigned16 and unsigned8 references in the code.
(cherry picked from commit bb5a80c05b)
2010-12-19 19:10:23 -02:00
Marcelo Roberto Jimenez
2ccaf7fac8 Remove unnecessary header <sys/utsname.h> from upnpapi.c.
(cherry picked from commit 7e8e5621a8)
2010-12-19 19:10:09 -02:00
Marcelo Roberto Jimenez
b1ae4db35a Use the new include files UpnpIntTypes.h, UpnpStdInt.h and UpnpUniStd.h.
Trying to keep platform dependency on the headers and clean the main
code a little bit.
2010-12-19 19:09:35 -02:00
Marcelo Roberto Jimenez
dd75baab6b White spaces.
(cherry picked from commit d6418b3e17)
2010-12-19 19:07:18 -02:00
Marcelo Roberto Jimenez
59c70e2a0e Doxygen.
(cherry picked from commit e8106e4f05)
2010-12-19 19:07:03 -02:00
Marcelo Roberto Jimenez
72233660b7 Fixes a bug introduced in a previous commit in http_SendMessage.
The variable num_read was beeing used without beeing initialized.

Also, clean up the function return path and make sure va_end()
is beeing called.
(cherry picked from commit 9a28fcc95b)
2010-11-24 12:33:53 -02:00
Marcelo Roberto Jimenez
3bf6f90751 Reformat calls to http_SendMessage().
(cherry picked from commit bfbd07cb40)
2010-11-24 12:33:52 -02:00
Marcelo Roberto Jimenez
0977f8864d soap_device: Doxygen and code reformat. 2010-11-24 12:33:52 -02:00
Fabrice Fontaine
57e9584f4e Major bug fix in http_SendMessage.
Currently, http_SendMessage was not able to write to write a buffer
due to a bad use of file_buf instead of buf. This bug was introduced by
the 0197-Doxygen-reformating-compiler-warnings patch.
(cherry picked from commit 2c3bce13bd)
2010-11-24 11:54:54 -02:00
Fabrice Fontaine
86783f0329 Returning the SID in Upnp_Event_Subscribe.
Currently, Upnp_Event_Subscribe always contains an empty chain in the
Sid parameter. This patch now saves the client Subscription ID in this
parameter so Control Points can see and use the same SID in the
Upnp_Event_Subscribe and in the Upnp_Event structures.
2010-11-24 11:54:24 -02:00
Juergen Lock
25641ac51a Two fixes from Juergen Lock <nox(at)jelal.kn-bremen.de>:
1. varargs:  pass size of CRLF as size_t not as int:

--- upnp/src/gena/gena_device.c.orig
+++ upnp/src/gena/gena_device.c
@@ -225,7 +225,7 @@ static UPNP_INLINE int notify_send_and_r
		"bbb",
		start_msg.buf, start_msg.length,
		propertySet, strlen(propertySet),
-		"\r\n", 2);
+		"\r\n", sizeof "\r\n" - 1);
	if (ret_code) {
		membuffer_destroy(&start_msg);
		sock_destroy(&info, SD_BOTH);

2. Remove "b" arg here, there is no buffer passed:  (this caused a pointer
to be interpreted as a buffer size to be alloc'd/copied, hence the 32 GB.)

--- upnp/src/genlib/net/http/webserver.c.orig
+++ upnp/src/genlib/net/http/webserver.c
@@ -1262,7 +1262,7 @@ static int process_request(
			// Content-Range: bytes 222-3333/4000  HTTP_PARTIAL_CONTENT
			// Transfer-Encoding: chunked
			if (http_MakeMessage(headers, resp_major, resp_minor,
-				"R" "TLD" "s" "tcS" "b" "Xc" "sCc",
+				"R" "TLD" "s" "tcS" "Xc" "sCc",
				HTTP_OK,    // status code
				finfo.content_type, // content type
				RespInstr,  // language info
(cherry picked from commit ed0ebe1588)
2010-11-22 23:29:28 -02:00
Marcelo Roberto Jimenez
252a25af32 White spaces.
(cherry picked from commit d057b2f82a11f4f4d5b9a7524e96348ad3c16106)
2010-11-22 13:21:12 -02:00
Marcelo Roberto Jimenez
f260a0e9d6 Template object for ssdp_ResultData. 2010-11-22 10:22:06 -02:00
Marcelo Roberto Jimenez
9181020d3b Fix for compiler warning about conversion to off_t. 2010-11-22 10:21:28 -02:00
Marcelo Roberto Jimenez
1316c82d04 Remove the "xboolean" typedef from the code base.
(cherry picked from commit 6e7a2bb2dc)
2010-11-22 09:29:02 -02:00
Marcelo Roberto Jimenez
9e7e7e3b89 Doxygen, reformating, compiler warnings. 2010-11-21 22:36:14 -02:00
Marcelo Roberto Jimenez
978f10449f ssdp, soap, genlib: fix compiler warnings. 2010-11-21 22:33:05 -02:00
Marcelo Roberto Jimenez
2685b5bb65 gena: fix several compiler warnings. 2010-11-20 14:19:09 -02:00
Marcelo Roberto Jimenez
5bb8ee4b02 uuid.c: fix compiler warnings.
(cherry picked from commit 09f2b6ca30)
2010-11-20 13:50:28 -02:00
Marcelo Roberto Jimenez
c45640f619 upnp: fix for compiler warnings.
(cherry picked from commit 9b3a0999a9)
2010-11-18 15:12:18 -02:00
Marcelo Roberto Jimenez
ec0035ca83 upnp: fix for compiler warnings and incorrect API. 2010-11-18 15:12:18 -02:00
Marcelo Roberto Jimenez
4c2aa70a3a samples: One more code reorganization.
(cherry picked from commit 6bee05a517)
2010-11-18 15:12:18 -02:00
Marcelo Roberto Jimenez
838a8fea28 samples: fix compiler warnings.
(cherry picked from commit 2e96edcbc5)
2010-11-18 15:12:18 -02:00
Marcelo Roberto Jimenez
f088f94803 samples: More code reorganization.
(cherry picked from commit ef0aa38958)
2010-11-18 12:04:02 -02:00
Marcelo Roberto Jimenez
b3fdad3988 samples: Put more data in common_data.h.
(cherry picked from commit 86159bc2a6)
2010-11-18 01:08:12 -02:00
Marcelo Roberto Jimenez
60279a57cc samples: Unified sample code.
This patch removes duplicated code in samples.
2010-11-18 01:07:20 -02:00
Marcelo Roberto Jimenez
f9d9091a94 Remove "upnp_" prefix from samples. 2010-11-17 23:35:07 -02:00
Marcelo Roberto Jimenez
57b1169850 samples: Fix compiler warnings. 2010-11-17 12:01:04 -02:00
Marcelo Roberto Jimenez
4d2f1f7ba6 Fix some compiler warnings and some Doxygen. 2010-11-17 01:33:57 -02:00
Marcelo Roberto Jimenez
d5fa48bd37 Some Doxygen in upnp_tv_device. 2010-11-16 23:19:33 -02:00
Marcelo Roberto Jimenez
0d625bd2e1 Some Doxygen on sample_util. 2010-11-16 22:47:22 -02:00
Marcelo Roberto Jimenez
bc8eebf6f8 Deal with -ansi in list.h. 2010-11-16 22:11:03 -02:00
Marcelo Roberto Jimenez
ab27615855 Removes C++ style comments. 2010-11-16 11:57:37 -02:00
Marcelo Roberto Jimenez
a15d46e142 Deal with "inline" when "-ansi" compiler option is active.
This mode can be recognized by the macro __STRICT_ANSI__.

From man gcc:

-ansi
 In C mode, this is equivalent to -std=c89. In C++ mode, it is equivalent to
-std=c++98.

 This turns off certain features of GCC that are incompatible with ISO C90
(when compiling C code), or of standard (when compiling code), such as the
asm and typeof keywords, and predefined macros such as unix and vax that
identify the type of system you are using. It also enables the undesirable
and rarely used ISO trigraph feature. For the C compiler, it disables
recognition of style // comments as well as the inline keyword.

 The alternate keywords _ _asm_ _, _ _extension_ _, _ _inline_ _ and
_ _typeof_ _ continue to work despite -ansi. You would not want to use them
in an ISO C program, of course, but it is useful to put them in header files
that might be included in compilations done with -ansi. Alternate predefined
macros such as _ _unix_ _ and _ _vax_ _ are also available, with or without
-ansi.

 The -ansi option does not cause non-ISO programs to be rejected gratuitously.
For that, -pedantic is required in addition to -ansi.

 The macro _ _STRICT_ANSI_ _ is predefined when the -ansi option is used.
Some header files may notice this macro and refrain from declaring certain
functions or defining certain macros that the ISO standard doesn't call for;
this is to avoid interfering with any programs that might use these names for
other things.

 Functions that would normally be built in but do not have semantics defined
by ISO C (such as alloca and ffs) are not built-in functions when -ansi is
used.
(cherry picked from commit da7f3bf1c1)
2010-11-16 03:15:42 -02:00
Marcelo Roberto Jimenez
dd2624ebfe Added the convenience function UpnpResolveURL2() to upnptools.c.
This function avoids some unecessary memory allocation.
The memory alloc'd by this function must be freed later by the caller.
(cherry picked from commit 8651174861)
2010-11-15 01:02:07 -02:00
Marcelo Roberto Jimenez
5c8d118899 Fixes for list.h and poison.h to be used in C++ code.
- Add list.h and poison.h to Makefile.am;
- list.h cannot use the C++ reserved keyword new;
- Cast void pointers to the proper type;
- Proper C++ pointer arithmetic on poison.h.
2010-11-15 00:07:14 -02:00
Marcelo Roberto Jimenez
eb5db65692 ReadResponseLineAndHeaders() is static. 2010-11-11 21:59:39 -02:00
Fabrice Fontaine
b0cab00ca3 Add GENA_NOTIFICATION_xxx_TIMEOUT variable.
Currently, in notify_send_and_recv function, pupnp waits for
HTTP_DEFAULT_TIMEOUT seconds when trying to send a GENA notification.
When there is a lot of notifications with CPs which was disconnected
without unsusbcribing, all the pupnp threads are blocked on this
timeout. To correct, this issue, this patch adds a new variable,
GENA_NOTIFICATION_SENDING_TIMEOUT, which can be used to lower the
timeout so GENA threads return quickly when writing is impossible. By
the same mean, pupnp waits the CP's answer to the NOTIFY for
HTTP_DEFAULT_TIMEOUT seconds, so this patch adds a new variable,
GENA_NOTIFICATION_ANSWERING_TIMEOUT, to customize this value.
(cherry picked from commit e6c548f57a)
2010-11-11 21:44:10 -02:00
Fabrice Fontaine
8811bf7ede Add --disable-blocking-tcp-connections flag.
Currently, pupnp is using a blocking connect to sends GENA
notifications. As a result, when there is a lot of notifications with
CPs which were disconnected without unsusbcribing, all the pupnp
threads are blocked for 20s (timeout). To correct this issue, this
patch replace the call to connect with a call to private_connect and add
a compilation flag to disable blocking TCP connections, so if we are not
able to connect to the CP, the notification is lost.
(cherry picked from commit 32cffb5bb5)
2010-11-11 21:43:55 -02:00
Marcelo Roberto Jimenez
02d0a48609 Remove commented old code from webserver.c.
(cherry picked from commit 2b30575ca5)
2010-11-11 21:33:58 -02:00
Fabrice Fontaine
6c64b7eeb5 Support for "polling" select in sock_read_write.
Currently, in sock_read_write function, if the timeout is 0, pupnp
realizes a "blocking" select (with an infinite timeout). With this
patch, if timeout is set to 0, pupnp will realize a "polling" select
and returns immediately if it can not read or write on the socket. This
is very useful for GENA notifications when pupnp is trying to send
events to a disconnected Control Point. "Blocking" select can now be
done by putting a negative timeout value.
2010-11-11 21:24:49 -02:00
Stefan Sommerfeld
8418b06bf1 Fixed a typo in upnp/inc/ActionComplete.h. 2010-11-07 19:01:30 -02:00
Stefan Sommerfeld
7b212cadc8 Fix for size_t in template. 2010-11-07 19:01:30 -02:00
Stefan Sommerfeld
818d61abc7 Fixed some typos.
(cherry picked from commit 508b782c79)
2010-11-07 18:59:53 -02:00
Stefan Sommerfeld
a0b0ca1434 Add a simple strndup() implementation for win32.
(cherry picked from commit 38d5e58e22)
2010-11-07 18:59:53 -02:00
Stefan Sommerfeld
7d3fc74ff7 Fix for size_t in UpnpString.
(cherry picked from commit ee5bd670d4)
2010-11-07 18:59:53 -02:00
Stefan Sommerfeld
51bf17911a Fix for size_t related warnings.
(cherry picked from commit fcb5e7c438)
2010-11-07 18:59:52 -02:00
Stefan Sommerfeld
d4358a82c5 Fix for inline usage.
(cherry picked from commit 243cd41974)
2010-11-07 18:59:52 -02:00
Marcelo Roberto Jimenez
09ede373c2 Remove unused parameter bufferLen from GetDescDocumentAndURL().
(cherry picked from commit 853cd32cfe)
2010-11-07 18:59:52 -02:00
Marcelo Roberto Jimenez
127b123c2c Consistent usage of win32 INVALID_SOCKET and SOCKET_ERROR.
On win32 socket() returns INVALID_SOCKET, which is unsigned,
on error, not -1.

Also, most network functions return SOCKET_ERROR.

This patch tries to make the usage consistent.
(cherry picked from commit f384e54fc6)
2010-11-07 18:59:52 -02:00
Stefan Sommerfeld
4da4ea639f Fixed server port definition.
(cherry picked from commit 9e12768cdb)
2010-11-07 18:59:52 -02:00
Stefan Sommerfeld
0c1ea1e61a Fix for mixed usage of SOCKET and int.
(cherry picked from commit 4b47e6a51d)
2010-11-07 18:59:52 -02:00
Stefan Sommerfeld
23b05a7f90 Make notify_send_and_recv() return the appropriate error code.
notify_send_and_recv() was returning the connection fd.
(cherry picked from commit a5fb5edfc9)
2010-11-07 18:59:52 -02:00
Marcelo Roberto Jimenez
c683bd90d6 Proper inclusion of inet_pton.h for win32.
(cherry picked from commit 8bd32d330b)
2010-11-07 18:59:52 -02:00
Stefan Sommerfeld
bb48d48977 fixed wrong declaration of inet_ntop4
(cherry picked from commit 00eb52cc85)
2010-11-07 18:59:52 -02:00
Marcelo Roberto Jimenez
a6c021226a Fix broken Makefile.am and remove unused file utilall.h.
(cherry picked from commit 9052ca95be)
2010-11-06 19:42:59 -02:00
Marcelo Roberto Jimenez
b59ec7d838 Fix for "SampleUtil_Initialize was called multiple times!" bug.
Fix for bug introduced in samples code in svn revision 502, commit
git:25c908c558c8e60eb386c155a6b93add447ffec0

Sample device and combo were aborting with the message:
"***** SampleUtil_Initialize was called multiple times!"
(cherry picked from commit ef7edf6cf8)
2010-11-06 00:46:58 -02:00
Fabrice Fontaine
8e0c92a52a Make multiple SSDP advertisements faster.
Put the loop to send multiple copies of each SSDP advertisements in
ssdp_server.c instead of ssdp_device.c so we have only one call to
imillisleep ( SSDP_PAUSE ) to speed up advertisements.
(cherry picked from commit c65ec8a720)
2010-11-05 23:54:04 -02:00
Fabrice Fontaine
56e0fdd438 Removing unused NUM_COPY variable.
Previously, NUM_COPY was used in ssdp_device.c to send multiple copies
of each advertisements but also multiple replies to each M-SEARCH
request. As sending multiple replies is not compliant with HTTPU/MU
spec, NUM_COPY has been set to 1 in an older patch. However, as this
variable is not needed and has been replaced with SSDP_COPY, it has
been removed.
(cherry picked from commit 2d22e997e1)
2010-11-05 23:53:55 -02:00
Fabrice Fontaine
b8b5f6a0ef Use SSDP_COPY to send multiple SSDP advertisements.
Currently, SSDP_COPY is used only to send multiple M-SEARCH requests (in
ssdp_ctrlpt.c). With this patch, SSDP_COPY is also used to send multiple
copies of each advertisements packets (in ssdp_device.c).
(cherry picked from commit 96dc968f18)
2010-11-05 13:29:35 -02:00
Carl Benson
4d37927c64 patch for taking notice of UPNP_USE_RWLOCK flag in threadutil
By "Carl Benson" <carl.benson@windriver.com>:

I had to do some modifications myself though, because the Android
build system insists on having a file named "util.h" taking precedence
in its include path, libupnp gets confused because of the same filename
in upnp/src/inc/util.h

(hand cherry picked from commit 8e846368e0)
2010-11-01 01:11:21 -02:00
Marcelo Roberto Jimenez
499753ba46 Remove the object from the list upon destruction. 2010-10-21 08:29:52 -02:00
Marcelo Roberto Jimenez
224c07de81 Copyright notice. 2010-10-21 08:29:52 -02:00
Marcelo Roberto Jimenez
a00919fe05 .gitignore for unittest/templates/*.pp.c. 2010-10-21 00:52:09 -02:00
Marcelo Roberto Jimenez
3ec269c872 Add some skeleton for unit testing. Start with template objects. 2010-10-21 00:43:33 -02:00
Marcelo Roberto Jimenez
45461f738d Template object for lists. 2010-10-21 00:27:57 -02:00
Marcelo Roberto Jimenez
f94fdc0afb Doxygen and indentation for sock.
(cherry picked from commit cc472bc2cd)
2010-10-20 10:12:23 -02:00
Marcelo Roberto Jimenez
dcf2040e45 Doxygen and indentation for miniserver.
(cherry picked from commit 6128296e5f)
2010-10-20 10:12:23 -02:00
Marcelo Roberto Jimenez
80c2b7a82a Indent plus Doxygen in webserver. 2010-10-20 02:09:28 -02:00
Marcelo Roberto Jimenez
c874c62472 Slightly better implementation for ToUpperCase().
(cherry picked from commit 113ebd1f91)
2010-10-20 01:44:56 -02:00
Marcelo Roberto Jimenez
b67c321869 Fix a long date memory leak in webserver.c:StrStr().
(cherry picked from commit bf1450bf81)
2010-10-20 01:44:56 -02:00
Marcelo Roberto Jimenez
1cc60c83f4 Bug fix in select of miniserver.c
Fix a bug in miniserver.c, in which maxMiniSock was wrongly declared as
unsigned int and as a result it was beeng set to ((unsigned int)(-1)).
As a result, after beeing incremented, it became zero, and this value
was beeing used in the select() call.

Thanks to Fabrice Fontaine for helping and testing with this issue.
(cherry picked from commit 2bdc9e075e)
2010-10-19 16:05:38 -02:00
Marcelo Roberto Jimenez
6f9661040f Fix for 100% CPU issue in select() in miniserv.c. I have also removed
the sleep() call, it was just a workaround.

SF Bug Tracker [ 3086852 ] 99% CPU loop in miniserver.c on a non ipv6
system.

Submitted by: Jin ( jin_eld ) - 2010-10-13 19:29:13 UTC

I cross compiled libupnp 1.6.7 for ARM9 using the --disable-ipv6
option, my system is an ipv4 only setup.

I do not know why this problem only appears when running the app in the
background (for instance using nohup &), but then it starts using 99%
CPU.

I traced the problem down to the select() call in miniserver.c in the
RunMiniServer() function. Select returns code 1, but errno is set to
"Socket operation on non-socket", I also see this when running my app
under strace.

I set all ...Sock6 variables to INVALID_SOCKET to make sure that they
do not get added to the FD_SET and the problem is gone.
(cherry picked from commit f74746ff3f)
2010-10-15 12:43:17 -03:00
Marcelo Roberto Jimenez
d3a7912741 New function, sock_close().
(cherry picked from commit 8401a59ed5)
2010-10-15 12:43:17 -03:00
Marcelo Roberto Jimenez
b6ec42b439 Misplaced declaration of UpnpCloseSocket.
(cherry picked from commit 5b40cfa272)
2010-10-15 12:43:16 -03:00
Marcelo Roberto Jimenez
6b496561b6 Remove of unused file.
(cherry picked from commit fcda28ba75)
2010-10-15 12:43:16 -03:00
Marcelo Roberto Jimenez
549ac300f7 Tempplat object for ClientSubscription. 2010-10-04 17:48:51 -03:00
Marcelo Roberto Jimenez
9e77129b87 Fix function prototype. 2010-10-04 16:52:48 -03:00
Marcelo Roberto Jimenez
6d8aa815ea Merge of similar files. 2010-10-04 15:35:59 -03:00
Marcelo Roberto Jimenez
4f5d0e1d70 Merge of similar code. 2010-10-04 13:19:00 -03:00
Marcelo Roberto Jimenez
420c87761a Update build/inc/autoconfig.h and build/inc/upnpconfig.h at configure
time.
(cherry picked from commit a9b5081a08)
2010-10-04 10:53:33 -03:00
Marcelo Roberto Jimenez
efb5d0cadf Whitespace fix on soaplib.h.
(cherry picked from commit 95f7a7eeef)
2010-10-02 18:59:07 -03:00
Marcelo Roberto Jimenez
fec0dd041b Remove extra soaplib.h.
(cherry picked from commit ca50c2153e)
2010-10-02 18:58:53 -03:00
Fabrice Fontaine
af345c1d2c Adding --disable-notification-reordering option
Adding a configure flag to disable GENA notification reordering as even
with an imillisleep(1), this mechanism consumes too much CPU on embedded
devices when there is a burst of notifications.
(cherry picked from commit c73d870f46)
2010-10-02 13:55:42 -03:00
Fabrice Fontaine
ee8e52ea4a Bug fix when there is no service in embedded devices
When a device with embedded devices (like IGD) when created and one of
the embedded devices did not have any service, there was a Segmentation
Fault (see SF Tracker [ 2688125 ]).
(cherry picked from commit ab54cb3dc5)
2010-09-30 11:52:33 -03:00
Fabrice Fontaine
fe7a073bc7 Bug fix on burst of GENA notification
When a lot of notifications were generated by a device in a short
period of time then 100% of the CPU was used to reorder those
notifications by pushing back the thread in the job queue. This
mechanism has been modified so now thread sleep 1 ms before being
pushed back into the job queue.

Removing DEFAULT_SCHED_PARAM parameter and use
sched_get_priority_min(DEFAULT_POLICY) instead.
(cherry picked from commit c33b11d09f)
2010-09-28 20:44:06 -03:00
Fabrice Fontaine
6567f7ec0d Bug fix on M-SEARCH response
Devices must respond to M-SEARCH requests for any supported version and the
response should specify the same version as was contained in the search target.
Previously, the device did not answer if the M-SEARCH request did not
contain the same version number than the version number of the device.
(cherry picked from commit 4966423d96)
2010-09-22 15:39:05 -03:00
Fabrice Fontaine
5ead3f6fee Add Content-Language iff Accept-Language
Add Content-Language header in the response if and only if there is an Accept-Language header in the request.

Manually ported from revision d2238615e3.
2010-09-21 16:43:59 -03:00
Fabrice Fontaine
82beb315c2 Addition of WEB_SERVER_CONTENT_LANGUAGE parameter
This patch adds the WEB_SERVER_CONTENT_LANGUAGE parameter so the user can specify
the language used by the device during Description and Presentation steps of UPnP
through the HTTP CONTENT-LANGUAGE header.
By default, the WEB_SERVER_CONTENT_LANGUAGE is an empty string so no
CONTENT-LANGUAGE is added.
(cherry picked from commit 2fcbe6df52)
2010-09-21 08:50:18 -03:00
Fabrice Fontaine
4a8c4f5c50 Customize the stack size of the threads used by pupnp through the new THREAD_STACK_SIZE variable
This patch allows a user to customize the stack size of the threads used by
pupnp through the new THREAD_STACK_SIZE variable. This is especially useful
on embedded systems with limited memory where the user can set THREAD_STACK_SIZE
to ITHREAD_STACK_MIN.

However, as this modification can have side effects, I set 0 as the default
value, so threads will continue to use the default stack size of the system
(which varies greatly as stated in
https://computing.llnl.gov/tutorials/pthreads/).
(cherry picked from commit 467f9987a1)
2010-09-18 06:47:34 -03:00
Chandra Penke
ba4ea3bc9b Export upnp/inc/Template*.h 2010-09-18 06:47:06 -03:00
Fabrice Fontaine
935f5af066 Broken IPv6.
IPv6 is currently broken in latest release of branch-1.6.x, so find
a patch attached that correct the issue (small fixes on define,
undef and retVal).
(cherry picked from commit 55d581481f)
2010-09-16 08:23:31 -03:00
Marcelo Roberto Jimenez
123af5a67e Get rid of evil CLIENTONLY macro. 2010-09-15 06:05:02 -03:00
Marcelo Roberto Jimenez
8b801fe1dc White spaces. 2010-09-15 05:59:21 -03:00
Chandra Penke
48985cb81b Fix win32 compilation errors in visual studio
(cherry picked from commit ea00f0f222)
2010-09-15 05:52:57 -03:00
Marcelo Roberto Jimenez
fe778cfd00 Template object for SubscriptionRequest. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
c90d6492e8 Template object for StateVarRequest. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
942e0ec809 Template object for StateVarComplete. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
2616d4c76a Template object for FileInfo. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
86a7ec499a Template object for EventSubscribe. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
43621874e9 Template object for Event. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
9c7bdcffb4 Template object for Discovery. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
5e6b9c119a Template object for ActionRequest. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
c7475fab70 Template object for ActionComplete. 2010-09-12 00:28:35 -03:00
Marcelo Roberto Jimenez
cf79479b2b Introducing template object methods. 2010-09-12 00:28:22 -03:00
Marcelo Roberto Jimenez
81b28fbb90 Added UpnpString_cmp() and UpnpString_casecmp() methods to UpnpString.
UpnpString_set_String() and UpnpString_set_StringN now return error values.
String lenghts are size_t.
2010-09-11 17:53:49 -03:00
David Hoeung
c55eeccb67 Timeout for TCP connect
Hi,

I've made some modification to the libupnp v1.6.5
I've add a timeout for each TCP connect.

It is very useful when an UPnP device stop working and do not accept
connection for an UPnP action.

Modifications are only located in
upnp/src/genlib/net/http/httpreadwrite.c

For every TCP connection, I set the socket to non-blocking, perform
connect,
check result and wait during a timeout if necessary, then reset the
socket to blocking.

Please see this patch in attached file.

I hope it helps.

Regards,

David Hoeung
Consultant Extia
Orange Labs R&D

----
(cherry picked from commit 67009170d1)
2010-09-11 00:20:11 -03:00
Marcelo Roberto Jimenez
fdfcf75690 Remove some unused code plus some coding style in httpparser.c
(cherry picked from commit 0bec9ec1ae)
2010-09-10 19:51:54 -03:00