Forum Discussion: https://sourceforge.net/projects/mediatomb/forums/forum/440751/topic/5213262
2012 Samsung 6100 LED SmartTV Requests:
POST //upnp/control/cds HTTP/1.1
Accept: */*
User-Agent: SEC_HHP_[TV]UN55ES6100/1.0 DLNADOC/1.50
Host: 10.6.0.2:50500
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#X_GetFeatureList"
CONTENT-TYPE: text/xml; charset="utf-8"
Content-Length: 291
Connection: close
<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:X_GetFeatureList xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"></u:X_GetFeatureList></s:Body></s:Envelope>
Mediatomb returns:
HTTP/1.1 500 Internal Server Error
CONTENT-LENGTH: 411
CONTENT-TYPE: text/xml; charset=UTF-8
DATE: Fri, 25 May 2012 15:44:08 GMT
EXT:
SERVER: Linux/2.6.43.2-6.fc15.x86_64, UPnP/1.0, MediaTomb/0.12.1
CONNECTION: close
transferMode.dlna.org: Streaming
contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
TCPDump of a 2012 Samsung 6100 TV talking to mediatomb 0.12.1
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
See https://sourceforge.net/tracker/?func=detail&aid=3532724&group_id=129766&atid=715782 for explanation and workaround.
I've fixed this on my local mediatomb running on Mint/Ubuntu 12.04.
Modification to the UPNP server so that it can differentiate between
the '//' in ABSOLUTE urls like 'http://foo/bar/... and ABS_PATH like "//bar/..."
Samsung puts the double slash is as you know.
If we find it's an ABS_PATH // then we skip the first char, otherwise we barf with an internal server error later on.
Here's the patch I'm using:
--- mediatomb-0.12.1.orig/tombupnp/upnp/src/genlib/net/uri/uri.c
+++ mediatomb-0.12.1/tombupnp/upnp/src/genlib/net/uri/uri.c
@@ -1042,7 +1042,7 @@ parse_uri( const char *in,
out->path_type = REL_PATH;
}
- if( ( ( begin_hostport + 1 ) < max ) && ( in[begin_hostport] == '/' )
+ if( ( out->type == ABSOLUTE ) && ( ( begin_hostport + 1 ) < max ) && ( in[begin_hostport] == '/' )
&& ( in[begin_hostport + 1] == '/' ) ) {
begin_hostport += 2;
@@ -1054,11 +1054,18 @@ parse_uri( const char *in,
return begin_path;
} else {
+ if ( ( begin_hostport == 0 ) && ( ( begin_hostport + 1 ) < max ) && ( in[begin_hostport] == '/' )
+ && ( in[begin_hostport + 1] == '/' )) {
+ // The path starts with '//' - Samsung 8 series TVs do this... Skip the first character
+ begin_path = 1;
+ begin_fragment = 1;
+ } else {
+ begin_path = begin_hostport;
+ }
out->hostport.IPv4address.sin_port = 0;
out->hostport.IPv4address.sin_addr.s_addr = 0;
out->hostport.text.size = 0;
out->hostport.text.buff = 0;
- begin_path = begin_hostport;
}
begin_fragment =