Commit Graph

693 Commits

Author SHA1 Message Date
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
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
843b255518 PTHREAD_MUTEX_RECURSIVE on DragonFly is an enum.
SF Bug Tracker - ID: 3104527
Submitted: OBATA Akio ( obache ) - 2010-11-07 07:10:28 BRST

In threadutil/inc/ithread.h, it is expected that
PTHREAD_MUTEX_RECURSIVE is defined as macro. But on DragonFly BSD,
it is defined as enum, so not works as expected.

Attachment patch treat that DragonFly BSD always
have PTHREAD_MUTEX_RECURSIVE.
(cherry picked from commit ff006272b5)
2010-11-07 11:50:27 -02:00
Marcelo Roberto Jimenez
8196092f50 ftime(3) in -lcompat should not be checked.
SF Bug Tracker - ID: 3104521
Submitted: OBATA Akio ( obache ) - 2010-11-07 07:03:44 BRST

In configure.ac
AC_CHECK_FUNCS(ftime,, [AC_CHECK_LIB(compat, ftime)])

But since version 1.6.3, ftime(3) is not used, so it should be
removed, or introduce unwanted linkage with -lcompat.
(cherry picked from commit 852c301c5c)
2010-11-07 09:46:22 -02:00
Marcelo Roberto Jimenez
b6007d54d8 Changelog adjust because of new 1.6.x release. 2010-11-07 01:45:53 -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
c2fbc12362 .gitignore for unittest. 2010-10-21 08:48:08 -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