update shutdown

This commit is contained in:
Luke Pulverenti
2016-04-22 12:12:20 -04:00
parent f3c3c74d84
commit c94706d6ee
3 changed files with 39 additions and 2 deletions

View File

@@ -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;