Commit Graph

284 Commits

Author SHA1 Message Date
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
Marcelo Roberto Jimenez
458a9416c6 Merge of work from 1.8.x. 2010-10-04 12:04:38 -03:00
Marcelo Roberto Jimenez
b9eeb89250 Bumped Doxyfile version. 2010-10-04 11:44:06 -03:00
Marcelo Roberto Jimenez
a6e68b481d Updated THANKS. 2010-10-04 11:33:37 -03:00
Marcelo Roberto Jimenez
a19a896e88 Updated TODO list. 2010-10-04 11:28:37 -03:00
Marcelo Roberto Jimenez
cdee5b7cde UTF-8. 2010-10-04 11:11:33 -03:00
Marcelo Roberto Jimenez
dec78c8ef1 Echo the copy on configure output. 2010-10-04 11:01:28 -03:00
Marcelo Roberto Jimenez
fb62a5d42a Update files for windows compilation. 2010-10-04 10:51:30 -03:00
Marcelo Roberto Jimenez
a9b5081a08 Update build/inc/autoconfig.h and build/inc/upnpconfig.h at configure
time.
2010-10-04 10:47:39 -03:00
Marcelo Roberto Jimenez
3886a697b5 Remove build/inc/config.h. The right file is upnp/src/inc/config.h. 2010-10-04 10:42:32 -03:00
Marcelo Roberto Jimenez
3dab2bd00a Homekeeping for the next release. 2010-10-04 09:58:15 -03:00
Marcelo Roberto Jimenez
95f7a7eeef Whitespace fix on soaplib.h. 2010-10-02 18:57:35 -03:00
Marcelo Roberto Jimenez
ca50c2153e Remove extra soaplib.h. 2010-10-02 18:57:13 -03:00
Fabrice Fontaine
c73d870f46 Adding --disable-notification-reordering option
Adding a configure flag to disable GENA notification reordering as even
with an imillisleep(1), this mechanism consumes too much CPU on embedded
devices when there is a burst of notifications.
2010-10-02 13:44:52 -03:00
Fabrice Fontaine
ab54cb3dc5 Bug fix when there is no service in embedded devices
When a device with embedded devices (like IGD) when created and one of
the embedded devices did not have any service, there was a Segmentation
Fault (see SF Tracker [ 2688125 ]).
2010-09-30 11:51:06 -03:00
Fabrice Fontaine
c33b11d09f Bug fix on burst of GENA notification
When a lot of notifications were generated by a device in a short
period of time then 100% of the CPU was used to reorder those
notifications by pushing back the thread in the job queue. This
mechanism has been modified so now thread sleep 1 ms before being
pushed back into the job queue.

Removing DEFAULT_SCHED_PARAM parameter and use
sched_get_priority_min(DEFAULT_POLICY) instead.
2010-09-28 20:41:28 -03:00
Fabrice Fontaine
4966423d96 Bug fix on M-SEARCH response
Devices must respond to M-SEARCH requests for any supported version and the
response should specify the same version as was contained in the search target.
Previously, the device did not answer if the M-SEARCH request did not
contain the same version number than the version number of the device.
2010-09-22 15:34:45 -03:00
Marcelo Roberto Jimenez
2fb55d3874 White space fix. 2010-09-21 16:49:20 -03:00
Fabrice Fontaine
d2238615e3 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.
2010-09-21 13:50:29 -03:00
Fabrice Fontaine
2fcbe6df52 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.
2010-09-21 08:48:40 -03:00
Fabrice Fontaine
467f9987a1 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/).
2010-09-18 06:45:56 -03:00
Marcelo Roberto Jimenez
8fbecaee5e Another fix for Changelog. 2010-09-16 08:42:14 -03:00
Fabrice Fontaine
55d581481f 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).
2010-09-16 08:21:41 -03:00
Marcelo Roberto Jimenez
a0b405f902 White spaces. 2010-09-15 06:07:42 -03:00
Marcelo Roberto Jimenez
b37f9ac64a Get rid of evil CLIENTONLY macro. 2010-09-15 05:46:07 -03:00
Marcelo Roberto Jimenez
2dad42679d White spaces. 2010-09-15 05:44:36 -03:00
Chandra Penke
ea00f0f222 Fix win32 compilation errors in visual studio 2010-09-15 05:23:53 -03:00
Marcelo Roberto Jimenez
f3ae1b4116 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.
(cherry picked from commit 81b28fbb90)
2010-09-12 00:35:31 -03:00
David Hoeung
67009170d1 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

----
2010-09-11 00:17:55 -03:00
Warwick Harvey
2b399b1791 Take notice of UPNP_USE_RWLOCK flag.
Updated threadutil to use mutexes instead of read-write locks if
UPNP_USE_RWLOCK is false (0).
2010-09-10 22:43:30 -03:00
Marcelo Roberto Jimenez
0bec9ec1ae Remove some unused code plus some coding style in httpparser.c 2010-09-10 19:46:18 -03:00
Marcelo Roberto Jimenez
25a4bd6d25 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.
2010-09-10 19:26:10 -03:00
Marcelo Roberto Jimenez
5755ac022f SF Patch Tracker [ 2854711 ] Patch for Solaris10 compilation and usage
Submitted By: zephyrus ( zephyrus00jp )

Patch for Solaris10 compilation and usage.
2010-09-10 19:02:31 -03:00
Marcelo Roberto Jimenez
0158f52ee2 One setp further to stop the CLIENTONLY() mess. 2010-09-10 18:56:36 -03:00
Marcelo Roberto Jimenez
0db4a6beac Fix an UTF-8 issue in README. 2010-09-10 00:47:53 -03:00
Chandra Penke
575e5fc196 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.
(cherry picked from commit 7f1e164a5a)
2010-09-10 00:42:27 -03:00
Marcelo Roberto Jimenez
0e45dd9b8f 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:32:49 -03:00
Chandra Penke
ae516b6bd3 Add support for conditionally enabling ipv6
(cherry picked from commit 6b0d84fc95)
2010-09-10 00:32:49 -03:00
Chandra Penke
7137f6e261 Fix for compilation in debug builds.
Ensure internal methods are declared as static since debug builds don't inline.
2010-09-10 00:02:04 -03:00