Commit Graph

322 Commits

Author SHA1 Message Date
Fabrice Fontaine
e6c548f57a 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.
2010-11-11 21:42:50 -02:00
Fabrice Fontaine
32cffb5bb5 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.
2010-11-11 21:40:22 -02:00
Marcelo Roberto Jimenez
2b30575ca5 Remove commented old code from webserver.c. 2010-11-11 21:31:53 -02:00
Marcelo Roberto Jimenez
d32212a6fd Changelog and THANKS update. 2010-11-07 19:20:03 -02:00
Stefan Sommerfeld
508b782c79 Fixed some typos. 2010-11-07 18:42:44 -02:00
Stefan Sommerfeld
38d5e58e22 Add a simple strndup() implementation for win32. 2010-11-07 18:31:48 -02:00
Stefan Sommerfeld
ee5bd670d4 Fix for size_t in UpnpString. 2010-11-07 18:31:48 -02:00
Stefan Sommerfeld
fcb5e7c438 Fix for size_t related warnings. 2010-11-07 18:31:48 -02:00
Stefan Sommerfeld
243cd41974 Fix for inline usage. 2010-11-07 18:31:48 -02:00
Marcelo Roberto Jimenez
853cd32cfe Remove unused parameter bufferLen from GetDescDocumentAndURL(). 2010-11-07 18:31:48 -02:00
Marcelo Roberto Jimenez
f384e54fc6 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.
2010-11-07 18:31:47 -02:00
Stefan Sommerfeld
9e12768cdb Fixed server port definition. 2010-11-07 18:31:47 -02:00
Stefan Sommerfeld
4b47e6a51d Fix for mixed usage of SOCKET and int. 2010-11-07 17:52:14 -02:00
Stefan Sommerfeld
a5fb5edfc9 Make notify_send_and_recv() return the appropriate error code.
notify_send_and_recv() was returning the connection fd.
2010-11-07 17:52:14 -02:00
Marcelo Roberto Jimenez
8bd32d330b Proper inclusion of inet_pton.h for win32. 2010-11-07 17:52:14 -02:00
Stefan Sommerfeld
00eb52cc85 fixed wrong declaration of inet_ntop4 2010-11-07 17:52:14 -02:00
Marcelo Roberto Jimenez
ff006272b5 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.
2010-11-07 11:49:33 -02:00
Marcelo Roberto Jimenez
852c301c5c 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.
2010-11-07 09:45:05 -02:00
Marcelo Roberto Jimenez
d270499cd8 Homekeeping for the next release. 2010-11-07 01:43:50 -02:00
Marcelo Roberto Jimenez
6ac867bbb1 Fix the library numbers for release. 2010-11-07 01:33:18 -02:00
Marcelo Roberto Jimenez
9052ca95be Fix broken Makefile.am and remove unused file utilall.h. 2010-11-06 19:41:47 -02:00
Marcelo Roberto Jimenez
ef7edf6cf8 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!"
2010-11-06 00:45:24 -02:00
Fabrice Fontaine
c65ec8a720 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.
2010-11-05 23:52:17 -02:00
Fabrice Fontaine
2d22e997e1 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.
2010-11-05 23:52:11 -02:00
Fabrice Fontaine
96dc968f18 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).
2010-11-05 13:25:40 -02:00
Carl Benson
8e846368e0 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
2010-11-01 01:06:11 -02:00
Marcelo Roberto Jimenez
d6671c464f Bump config to 1.6.9. 2010-11-01 01:03:40 -02:00
Marcelo Roberto Jimenez
699dd3c82e Missed this line in configure.ac in the homekeeping commit. 2010-10-21 09:55:54 -02:00
Marcelo Roberto Jimenez
9be360bcd1 Homekeeping for the next release. 2010-10-20 11:15:23 -02:00
Marcelo Roberto Jimenez
593b8d0a2b Fixes in configure.ac for release. 2010-10-20 11:11:45 -02:00
Marcelo Roberto Jimenez
890c1b6ef8 Disable debug for release. 2010-10-20 10:36:11 -02:00
Marcelo Roberto Jimenez
c127a3a87e Add docs/doxygen to .gitignore. 2010-10-20 10:35:15 -02:00
Marcelo Roberto Jimenez
bd5758186c White spaces. 2010-10-20 10:29:45 -02:00
Marcelo Roberto Jimenez
cc472bc2cd Doxygen and indentation for sock. 2010-10-20 09:05:42 -02:00
Marcelo Roberto Jimenez
6128296e5f Doxygen and indentation for miniserver. 2010-10-20 08:56:06 -02:00
Marcelo Roberto Jimenez
d84c6a7e9f Indent plus Doxygen in webserver. 2010-10-20 01:28:37 -02:00
Marcelo Roberto Jimenez
113ebd1f91 Slightly better implementation for ToUpperCase(). 2010-10-20 00:36:47 -02:00
Marcelo Roberto Jimenez
bf1450bf81 Fix a long date memory leak in webserver.c:StrStr(). 2010-10-20 00:29:08 -02:00
Marcelo Roberto Jimenez
56b9c75056 Changelog fix. 2010-10-19 16:11:39 -02:00
Marcelo Roberto Jimenez
2bdc9e075e 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.
2010-10-19 15:49:36 -02:00
Marcelo Roberto Jimenez
923eee2393 Don't ask, UTF-8 mess? 2010-10-15 12:54:00 -03:00
Marcelo Roberto Jimenez
f74746ff3f 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.
2010-10-15 12:41:36 -03:00
Marcelo Roberto Jimenez
8401a59ed5 New function, sock_close(). 2010-10-15 12:25:35 -03:00
Marcelo Roberto Jimenez
5b40cfa272 Misplaced declaration of UpnpCloseSocket. 2010-10-15 12:17:15 -03:00
Marcelo Roberto Jimenez
fcda28ba75 Remove of unused file. 2010-10-15 11:53:25 -03:00
Marcelo Roberto Jimenez
7cd434225f White spaces and comments. 2010-10-04 17:05:43 -03:00
Marcelo Roberto Jimenez
78e5ba89fa Merge of similar files. 2010-10-04 15:48:45 -03:00
Marcelo Roberto Jimenez
ebb8f209b0 Merge of similar files. 2010-10-04 15:36:11 -03:00
Marcelo Roberto Jimenez
73afd667e1 Fix for bug introduced in the last commit. 2010-10-04 13:24:38 -03:00
Marcelo Roberto Jimenez
cc294a6cf1 Merge similar code. 2010-10-04 13:03:20 -03:00