Package: libupnp0
Version: 1.2.1-2
Severity: important
Tags: patch


When using libupnp to communicate with Windows Media Connect and
browsing a large directory on its Content Directory server (large => 15
files in this case), UpnpSendAction will return internal error -119,
UPNP_E_BAD_HTTPMSG because the http response parser in
genlib/net/http/httpreadwrite.c returns HTTP_REQ_ENTITY_TOO_LARGE on the
basis of a comparison of the parsed response's content_length with the
value g_maxContentLength. g_maxContentLength is arbitrarily set at
16000, and SOAP messages are unlimited in length, making this
restriction unhelpful in implementing compliant UPNP services.

In the context of receiving responses from remote servers, I believe the
restriction to be unnecessary. The parser allocates its buffer as data
comes in and fails 'gracefully' when it runs out of memory. The attached
patch removes the check, and running the code without the check seems to
cause no troubles for the purposes for which I am using it.

N.B.: I have not looked at the other code in the library in detail, and
have no doubt that there are places where this restriction is used to
make an assumption about the size of some other buffer. This obviously
needs fixing properly upstream, and I'm not recommending this patch is
included in the package, but attaching it for users in a similar
situation to my own.

-- System Information:
Debian Release: testing/unstable
 APT prefers unstable
 APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-skas3-v9-pre7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=sh: /usr/local/arm/3.3.1/bin/locale: cannot execute binary file)

Versions of packages libupnp0 depends on:
ii libc6 2.3.5-8.1 GNU C Library: Shared libraries an

libupnp0 recommends no packages.

-- debconf information excluded


--- upnp/src/genlib/net/http/httpreadwrite.orig 2006-01-27 16:41:10.000000000 +0000 +++ upnp/src/genlib/net/http/httpreadwrite.c 2006-01-27 16:35:35.000000000 +0000
@@ -214,11 +214,11 @@
                         //print_http_headers( &parser->msg );
                     )

-                    if( parser->content_length >
-                        ( unsigned int )g_maxContentLength ) {
-                    *http_error_code = HTTP_REQ_ENTITY_TOO_LARGE;
-                    return UPNP_E_BAD_HTTPMSG;
-                }
+//                    if( parser->content_length >
+//                        ( unsigned int )g_maxContentLength ) {
+//                    *http_error_code = HTTP_REQ_ENTITY_TOO_LARGE;
+//                    return UPNP_E_BAD_HTTPMSG;
+//                }

                return 0;
            } else if( status == PARSE_FAILURE ) {

--
Arthur Taylor, +44 (0) 1223 271512
Reciva Limited,
509 Coldhams Lane,
Cambridge,
CB1 3JS. England Fax: +44 (0) 1223 702991


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to