Skip to content
Browse files

Samsung 2012 TV fix for HTTPv2 engine.

  • Loading branch information...
1 parent e06111f commit ee165123541d145b246f1b39d8e4ef6e309b747b @trooperryan committed May 12, 2012
View
2 src/main/java/net/pms/network/HTTPXMLHelper.java
@@ -39,4 +39,6 @@
static final String XBOX_1 = "<u:IsValidatedResponse xmlns:u=\"urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1\">" + CRLF + "<Result>1</Result>" + CRLF + "</u:IsValidatedResponse>";
static final String XBOX_2 = "<u:IsAuthorizedResponse xmlns:u=\"urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1\">" + CRLF + "<Result>1</Result>" + CRLF + "</u:IsAuthorizedResponse>";
static final String UPNP_INVALID_ACTION = "<s:Fault><faultCode>s:Client</faultCode><faultString>UPnPError</faultString><detail><UPnPError xmlns=\"urn:schemas-upnp-org:control-1-0\"><errorCode>401</errorCode><errorDescription>Invalid Action</errorDescription></UPnPError></detail></s:Fault>";
+ static final String SAMSUNG_FEATURE_LIST = "<u:X_GetFeatureListResponse xmlns:u=\"urn:schemas-upnp-org:service:ContentDirectory\">" + CRLF + "<FeatureList><?xml version=\"1.0\" encoding=\"UTF-8\"?><Features xmlns=\"urn:schemas-upnp-org:av:avs\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:schemas-upnp-org:av:avs http://www.upnp.org/schemas/av/avs.xsd\"><Feature name=\"samsung.com_BASICVIEW\" version=\"2\"><container id=\"1\" type=\"object.item.imageItem\"/><container id=\"1\" type=\"object.item.audioItem\"/><container id=\"1\" type=\"object.item.videoItem\"/><container id=\"1\" type=\"object.item.textItem\"/></Feature><Feature name=\"samsung.com_DCMVIEW\" version=\"1\"><container id=\"I_M\" type=\"IMAGE_Monthly\"/><container id=\"I_C\" type=\"IMAGE_Color\"/><container id=\"I_T\" type=\"IMAGE_Timeline\"/><container id=\"I_P\" type=\"IMAGE_Composition\"/><container id=\"I_F\" type=\"IMAGE_Folder\"/><container id=\"I_N\" type=\"IMAGE_Title\"/><container id=\"I_L\" type=\"IMAGE_LatestDate\"/><container id=\"I_E\" type=\"IMAGE_EarliestDate\"/><container id=\"A_G\" type=\"AUDIO_Genre\"/><container id=\"A_A\" type=\"AUDIO_Artist\"/><container id=\"A_F\" type=\"AUDIO_Folder\"/><container id=\"A_M\" type=\"AUDIO_Mood\"/><container id=\"A_T\" type=\"AUDIO_Title\"/><container id=\"A_L\" type=\"AUDIO_Album\"/><container id=\"V_T\" type=\"VIDEO_Title\"/><container id=\"V_D\" type=\"VIDEO_Date\"/><container id=\"V_F\" type=\"VIDEO_Folder\"/><container id=\"V_L\" type=\"VIDEO_LatestDate\"/><container id=\"V_E\" type=\"VIDEO_EarliestDate\"/></Feature></Features></FeatureList>" + "</u:X_GetFeatureListResponse>";
}
+
View
3 src/main/java/net/pms/network/RequestHandlerV2.java
@@ -293,11 +293,12 @@ private void writeResponse(MessageEvent e, RequestV2 request, InetAddress ia) {
HttpResponseStatus.PARTIAL_CONTENT);
} else {
String soapAction = nettyRequest.getHeader("SOAPACTION");
+
if( (soapAction != null) && soapAction.contains("X_GetFeatureList") ) {
logger.debug("Invalid action in SOAPACTION: " + soapAction);
response = new DefaultHttpResponse(
HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR);
- } else {
+ } else {
response = new DefaultHttpResponse(
/*request.isHttp10() ? HttpVersion.HTTP_1_0
: */HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
View
1 src/main/java/net/pms/network/RequestV2.java
@@ -529,6 +529,7 @@ public ChannelFuture answer(
response.append(HTTPXMLHelper.SOAP_ENCODING_HEADER);
response.append(CRLF);
response.append(HTTPXMLHelper.UPNP_INVALID_ACTION);
+ //response.append(HTTPXMLHelper.SAMSUNG_FEATURE_LIST);
response.append(CRLF);
response.append(HTTPXMLHelper.SOAP_ENCODING_FOOTER);
response.append(CRLF);

3 comments on commit ee16512

@SubJunk
SubJunk commented on ee16512 Jun 7, 2012

It seems like this revision doesn't do anything, since it adds SAMSUNG_FEATURE_LIST but doesn't use it. Were you intending to do something with it?

@trooperryan
Owner

Correct its some WIP I was doing trying to reverse how Samsung's Allshare server software works. My first forray into git and github = fail

@SubJunk
SubJunk commented on ee16512 Jun 7, 2012

Cool :) You might be interested to know that your patch will be featured in the next release of Universal Media Server, and of course credit will be given to you in the changelog :)

Please sign in to comment.
Something went wrong with that request. Please try again.