Commit Graph

658 Commits

Author SHA1 Message Date
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
Marcelo Roberto Jimenez
28ef8caad8 Fix for Changelog. 2010-09-16 08:40:25 -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
Warwick Harvey
e0806a2116 Take notice of UPNP_USE_RWLOCK flag.
Updated threadutil to use mutexes instead of read-write locks if
UPNP_USE_RWLOCK is false (0).
(cherry picked from commit 2b399b1791)
2010-09-10 22:46:26 -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
Marcelo Roberto Jimenez
e6d7eb7767 2010-09-10 Jean Sigwald <jean.sigwald(at)orange-ftgroup.com>
I discovered a reliable denial-of-service issue on the last stable
release of libupnp (1.6.6) remotely triggerable by any
unauthenticated user. The issue is related with a bad parsing of
malformed XML.
(cherry picked from commit 25a4bd6d25)
2010-09-10 19:51:54 -03:00
Marcelo Roberto Jimenez
6604d0a974 SF Patch Tracker [ 2854711 ] Patch for Solaris10 compilation and usage
Submitted By: zephyrus ( zephyrus00jp )

Patch for Solaris10 compilation and usage.
(cherry picked from commit 5755ac022f)
2010-09-10 19:04:35 -03:00
Marcelo Roberto Jimenez
30ee3c0cbb One setp further to stop the CLIENTONLY() mess.
(cherry picked from commit 0158f52ee2)
2010-09-10 19:04:35 -03:00
Marcelo Roberto Jimenez
159d2b1b1f Fix an UTF-8 issue in README.
(cherry picked from commit 0db4a6beac)
2010-09-10 00:48:44 -03:00
Chandra Penke
7f1e164a5a SUMMARY: Minor change in comment for SetMaxContentLenght in upnp.h
This is a follow up from issue 6 in tracker id 3056713: calling UpnpSetMaxContentLength() by passing '0' disables the content length checking. This is useful for developing some prototype applications that deal with a lot of XML/SOAP data, and for debugging.

The corresponding c file change is already in the pupnp tree. Copy/pasting the relevant block of code here for clarity:

In upnp/src/genlib/net/http/httpreadwrite.c:

if (g_maxContentLength > 0 && parser->content_length > (unsigned int)g_maxContentLength) {
	*http_error_code = HTTP_REQ_ENTITY_TOO_LARGE;
	line = __LINE__;
	ret = UPNP_E_OUTOF_BOUNDS;
	goto ExitFunction;
}

This block of code checks only does the bounds check if g_maxContentLength > 0, and it's only place g_maxContentLength is checked.

Attached is a patch against the latest sources.
2010-09-10 00:41:17 -03:00
Marcelo Roberto Jimenez
82a6e9f0cc Fix for coding style and compiler warning message:
src/genlib/miniserver/miniserver.c: In function ‘get_miniserver_sockets’:
src/genlib/miniserver/miniserver.c:592: warning: unused variable ‘actual_port6’
src/genlib/miniserver/miniserver.c:582: warning: unused variable ‘__ss_v6’
2010-09-10 00:18:24 -03:00
Chandra Penke
6b0d84fc95 Add support for conditionally enabling ipv6 2010-09-10 00:08:16 -03:00
Chandra Penke
15fb28c622 Fix for compilation in debug builds.
Ensure internal methods are declared as static since debug builds don't inline.
2010-09-10 00:00:00 -03:00
Marcelo Roberto Jimenez
0833b880d4 Fix for UpnpPrintf() in Chandra Penke's last commit.
src/ssdp/ssdp_ctrlpt.c: In function ‘SearchByTarget’:
src/ssdp/ssdp_ctrlpt.c:634: warning: format ‘%s’ expects type ‘char *’, but argument 6 has type ‘int’
(cherry picked from commit 92b241b560)
2010-09-09 23:01:09 -03:00
Chandra Penke
019c57eee0 Fix for regression in SSDP code to send/receive messages over UDP
Sending messages over UDP is broken in some Apple OSes
such as OS X and iOS. This might be broken in other OSes to but didn't
verify.

The fix is to modify the socket lenght argument of sendto to use the correct
sockaddr lenght dependng on whether the socket is IPV4 or IPV6.

Also added some error checks and debugging related to the issue
(cherry picked from commit 2b3ab1799b)
2010-09-09 23:01:09 -03:00
Marcelo Roberto Jimenez
64dedf72a8 Using UpnpReadHttpGet to download large files causes the application to
crash. This happens when the file being downloaded exceeds the device
memory - entirely possible when transferring video files.
The programmatic cause is that the logic implemented in the function
http_ReadHttpGet (which UpnpReadHttpGet calls) reads the entire file
into memory. The fix modifies the existing logic to discard data after
it's been read; there's no reason to keep it around since the caller
of UpnpReadHttpGet already has a copy of it.

This issue exists in 1.6.6 as well as the latest sources.

Patch submitted by Chandra (inactiveneurons).
(cherry picked from commit 4657e57766)
2010-09-07 22:49:34 -03:00
Marcelo Roberto Jimenez
a3efd63c5f In the latest sources, http_RequestAndResponse and other methods that
use connect() are broken. More specifically, connect() in these methods
is returning with an EINVAL. The programatic cause is that the address_len
argument passed to connect() is different in IPV4 vs IPV6 (as described in:
http://www.opengroup.org/onlinepubs/009695399/functions/connect.html).
The current code always uses the IPV6 size. The fix modifies each use of
connect() to use the correct size based on the address family being used.

Patch submitted by Chandra (inactiveneurons).
(cherry picked from commit 21660334e4)
2010-09-07 22:49:34 -03:00
Marcelo Roberto Jimenez
cf40abd922 Fix compilation error in upnp/src/gena/gena_ctrlpt.c (this is most
likely an error on all platforms).

Patch submitted by Chandra (inactiveneurons).
(cherry picked from commit 97af8b6fdb)
2010-09-07 22:49:34 -03:00
Marcelo Roberto Jimenez
4661334870 Fix compilation error in upnp/src/inc/ssdplib.h when compiling in OS X
(the netinet/* headers are not available).

Patch submitted by Chandra (inactiveneurons).
(cherry picked from commit 934bd2682f)
2010-09-07 22:49:34 -03:00
Marcelo Roberto Jimenez
4ebf890e92 Fix compilation error in ixml/inc/ixml.h when compiling with an
Objective-C compiler (when cross-compiling for iPhone devices).

Patch submitted by Chandra (inactiveneurons).
(cherry picked from commit b8e9628140)
2010-09-07 22:49:34 -03:00
Marcelo Roberto Jimenez
f97315f778 White spaces.
(cherry picked from commit b3b7a91a64)
2010-09-07 11:45:59 -03:00
Marcelo Roberto Jimenez
947599710d Issue regarding the GENA notifications. A string termination indicator was added
at the end of the notification ("\r\n") in notify_send_and_recv() in
upnp/src/gena/gena_device.c.

Patch by Fabrice Fontaine.
(cherry picked from commit ebc941f265)
2010-09-07 11:45:59 -03:00
Marcelo Roberto Jimenez
36a6887834 Adding .gitignore.
(cherry picked from commit 842a6ce5c8)
2010-09-07 11:45:59 -03:00
Marcelo Roberto Jimenez
a15e0c99d7 * upnp/src/api/Discovery.c: Fix a serious bug and memory leak in
UpnpDiscovery_strcpy_DeviceType(). Thanks to David Blanchet for the
patch.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@584 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-22 11:32:09 +00:00
Marcelo Roberto Jimenez
93a3016df1 Forward port of svn rev. 581: White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@583 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-22 02:13:34 +00:00
Marcelo Roberto Jimenez
36d6a34f5d Forward port of svn rev. 580:
The last part of Ronan Menard's patch.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@582 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-22 02:11:44 +00:00
Marcelo Roberto Jimenez
9763158d69 Forward port of svn rev. 578:
* upnp/src/ssdp/ssdp_device.c: Fix for IPV6 ULA/GUA issues.
* upnp/src/ssdp/ssdp_ctrlpt.c: Fix for IPV6 ULA/GUA issues.
* upnp/src/ssdp/ssdp_server.c: Fix for IPV6 ULA/GUA issues.

Patch submitted by Ronan Menard.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@579 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-22 01:44:25 +00:00
Marcelo Roberto Jimenez
2963919081 Forward port of svn rev. 576:
* upnp/src/genlib/miniserver/miniserver.c: Fix for IPV6 ULA/GUA issues.

Patch submitted by Ronan Menard.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@577 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-21 22:16:24 +00:00
Marcelo Roberto Jimenez
9f7936781e Forward port of svn rev. 574:
* gena_subscribe(): Fix for IPV6 ULA/GUA issues.

Patch submitted by Ronan Menard.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@575 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-21 21:57:40 +00:00
Marcelo Roberto Jimenez
bc724a8073 Forward port of svn rev. 572:
* SOCKET ssdpSock6UlaGua: created variable for later use.

Patch submitted by Ronan Menard.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@573 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-21 21:43:54 +00:00
Marcelo Roberto Jimenez
7ff1d56906 Forward port of svn rev. 569:
* SSDP_IPV6_SITELOCAL: new macro.

Patch submitted by Ronan Menard.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@571 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-21 21:36:22 +00:00
Marcelo Roberto Jimenez
2150bdc5b6 Forward port of svn rev. 568:
The scope of the macro NUM_HANDLE is now restricted to upnpapi.c.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@570 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-08-21 21:34:17 +00:00