Commit Graph

521 Commits

Author SHA1 Message Date
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
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
5b2d1717bc Add docs/doxygen to .gitignore.
(cherry picked from commit c127a3a87e)
2010-10-20 10:50:20 -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
77b96765b9 Changelog fix.
(cherry picked from commit 56b9c75056)
2010-10-19 16:12:08 -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
5d651475d5 Don't ask, UTF-8 mess?
(cherry picked from commit 923eee2393)
2010-10-15 12:54:50 -03: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
60b26c913d Fixed spec version. 2010-10-04 11:48:25 -03:00
Marcelo Roberto Jimenez
bc3d84f6ba Updated Changelog and config.ac to make it easy to cherry-pick. 2010-10-04 11:48:25 -03:00