aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-02 01:49:16 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-02 01:49:16 -0400
commitf6ef72732178db79176d238206ca83150f6c80d4 (patch)
tree9e0a32286a6a5ff014f1fa777bb17cebc4097abe /MediaBrowser.Server.Implementations/HttpServer
parent780d5b914cc22bdf88477761e60c5de64b20504d (diff)
parentcd02373e554df232d88063f41b8aee391f3e7667 (diff)
Merge branch 'dev'
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
index 25463b660..c5cb810e5 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -179,6 +179,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer
private void OnWebSocketConnecting(WebSocketConnectingEventArgs args)
{
+ if (_disposed)
+ {
+ return;
+ }
+
if (WebSocketConnecting != null)
{
WebSocketConnecting(this, args);
@@ -187,6 +192,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer
private void OnWebSocketConnected(WebSocketConnectEventArgs args)
{
+ if (_disposed)
+ {
+ return;
+ }
+
if (WebSocketConnected != null)
{
WebSocketConnected(this, args);
@@ -331,6 +341,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer
var httpRes = httpReq.Response;
+ if (_disposed)
+ {
+ httpRes.StatusCode = 503;
+ httpRes.Close();
+ return Task.FromResult(true);
+ }
+
var operationName = httpReq.OperationName;
var localPath = url.LocalPath;