Commit Graph

566 Commits

Author SHA1 Message Date
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
ad0584150f Changelog fix from 1.6.x. 2010-12-11 16:53:32 -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
196a99d1c7 Update to 1.8.x configure.ac. 2010-11-18 13:21:38 -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
05ce67b61b Update autoconfig.h.
(cherry picked from commit 8434e1e936)
2010-11-17 23:38:49 -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
18f80bd778 threadutil: Doxygenation and compiler warnings.
(cherry picked from commit 7c524df1d9)
2010-11-16 03:15:56 -02:00
Marcelo Roberto Jimenez
297d2ae877 ixml: Fix for compiler warnings for size_t and ptrdiff_t.
ixmlparser.c static functions have been reordered.
(cherry picked from commit 58c694f57d)
2010-11-16 03:15:49 -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
Marcelo Roberto Jimenez
1fd443f79f Changelog and THANKS update.
(cherry picked from commit d32212a6fd)
2010-11-07 19:21:20 -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