aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/Service/BaseControlHandler.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-31 10:32:28 -0600
committercrobibero <cody@robibe.ro>2020-08-31 10:32:28 -0600
commit95402df88408b96300e627b9962d0e4db2e4c7c5 (patch)
tree91cc4d6c271e99256a39f3cacbe1a49bb40ef71a /Emby.Dlna/Service/BaseControlHandler.cs
parente48df7da5e3d3eb81f68e71c0fe27a64063f00ac (diff)
parent95142643f6c98fe4380c63ba9b3055fd3a637466 (diff)
Merge remote-tracking branch 'upstream/master' into default-http-client
Diffstat (limited to 'Emby.Dlna/Service/BaseControlHandler.cs')
-rw-r--r--Emby.Dlna/Service/BaseControlHandler.cs34
1 files changed, 17 insertions, 17 deletions
diff --git a/Emby.Dlna/Service/BaseControlHandler.cs b/Emby.Dlna/Service/BaseControlHandler.cs
index 699d325ea..d160e3339 100644
--- a/Emby.Dlna/Service/BaseControlHandler.cs
+++ b/Emby.Dlna/Service/BaseControlHandler.cs
@@ -15,11 +15,7 @@ namespace Emby.Dlna.Service
{
public abstract class BaseControlHandler
{
- private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/";
-
- protected IServerConfigurationManager Config { get; }
-
- protected ILogger Logger { get; }
+ private const string NsSoapEnv = "http://schemas.xmlsoap.org/soap/envelope/";
protected BaseControlHandler(IServerConfigurationManager config, ILogger logger)
{
@@ -27,6 +23,10 @@ namespace Emby.Dlna.Service
Logger = logger;
}
+ protected IServerConfigurationManager Config { get; }
+
+ protected ILogger Logger { get; }
+
public async Task<ControlResponse> ProcessControlRequestAsync(ControlRequest request)
{
try
@@ -80,10 +80,10 @@ namespace Emby.Dlna.Service
{
writer.WriteStartDocument(true);
- writer.WriteStartElement("SOAP-ENV", "Envelope", NS_SOAPENV);
- writer.WriteAttributeString(string.Empty, "encodingStyle", NS_SOAPENV, "http://schemas.xmlsoap.org/soap/encoding/");
+ writer.WriteStartElement("SOAP-ENV", "Envelope", NsSoapEnv);
+ writer.WriteAttributeString(string.Empty, "encodingStyle", NsSoapEnv, "http://schemas.xmlsoap.org/soap/encoding/");
- writer.WriteStartElement("SOAP-ENV", "Body", NS_SOAPENV);
+ writer.WriteStartElement("SOAP-ENV", "Body", NsSoapEnv);
writer.WriteStartElement("u", requestInfo.LocalName + "Response", requestInfo.NamespaceURI);
WriteResult(requestInfo.LocalName, requestInfo.Headers, writer);
@@ -210,15 +210,6 @@ namespace Emby.Dlna.Service
}
}
- private class ControlRequestInfo
- {
- public string LocalName { get; set; }
-
- public string NamespaceURI { get; set; }
-
- public Dictionary<string, string> Headers { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- }
-
protected abstract void WriteResult(string methodName, IDictionary<string, string> methodParams, XmlWriter xmlWriter);
private void LogRequest(ControlRequest request)
@@ -240,5 +231,14 @@ namespace Emby.Dlna.Service
Logger.LogDebug("Control response. Headers: {@Headers}\n{Xml}", response.Headers, response.Xml);
}
+
+ private class ControlRequestInfo
+ {
+ public string LocalName { get; set; }
+
+ public string NamespaceURI { get; set; }
+
+ public Dictionary<string, string> Headers { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ }
}
}