aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/SocketSharp
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/SocketSharp')
-rw-r--r--Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs10
-rw-r--r--Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs12
-rw-r--r--Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpResponse.cs1
3 files changed, 8 insertions, 15 deletions
diff --git a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
index e71b99e8c..10aaa4032 100644
--- a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
+++ b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs
@@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
}
public Action<Exception, IRequest, bool> ErrorHandler { get; set; }
- public Func<IHttpRequest, Uri, CancellationToken, Task> RequestHandler { get; set; }
+ public Func<IHttpRequest, string, string, string, CancellationToken, Task> RequestHandler { get; set; }
public Action<WebSocketConnectingEventArgs> WebSocketConnecting { get; set; }
@@ -114,7 +114,9 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
return Task.FromResult(true);
}
- return RequestHandler(httpReq, request.Url, cancellationToken);
+ var uri = request.Url;
+
+ return RequestHandler(httpReq, uri.OriginalString, uri.Host, uri.LocalPath, cancellationToken);
}
private void ProcessWebSocketRequest(HttpListenerContext ctx)
@@ -177,7 +179,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
return req;
}
- public void Stop()
+ public Task Stop()
{
_disposeCancellationTokenSource.Cancel();
@@ -190,6 +192,8 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
_listener.Close();
}
+
+ return Task.FromResult(true);
}
public void Dispose()
diff --git a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
index 7c5feb615..522377f0c 100644
--- a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
+++ b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
@@ -246,13 +246,12 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
set
{
this.responseContentType = value;
- HasExplicitResponseContentType = true;
}
}
public const string FormUrlEncoded = "application/x-www-form-urlencoded";
public const string MultiPartFormData = "multipart/form-data";
- private static string GetResponseContentType(IRequest httpReq)
+ public static string GetResponseContentType(IRequest httpReq)
{
var specifiedContentType = GetQueryStringContentType(httpReq);
if (!string.IsNullOrEmpty(specifiedContentType)) return specifiedContentType;
@@ -360,8 +359,6 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
: strVal.Substring(0, pos);
}
- public bool HasExplicitResponseContentType { get; private set; }
-
public static string HandlerFactoryPath;
private string pathInfo;
@@ -504,13 +501,6 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
get { return HttpMethod; }
}
- public string Param(string name)
- {
- return Headers[name]
- ?? QueryString[name]
- ?? FormData[name];
- }
-
public string ContentType
{
get { return request.ContentType; }
diff --git a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpResponse.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpResponse.cs
index d6762d94b..5b51c0cf1 100644
--- a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpResponse.cs
+++ b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpResponse.cs
@@ -29,7 +29,6 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
}
public IRequest Request { get; private set; }
- public bool UseBufferedStream { get; set; }
public Dictionary<string, object> Items { get; private set; }
public object OriginalResponse
{