mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-22 18:23:45 +00:00
Remove dead code and improve logging
This commit is contained in:
@@ -520,7 +520,7 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("WS Request from {IP}", context.Connection.RemoteIpAddress);
|
||||
_logger.LogInformation("WS {IP} request", context.Connection.RemoteIpAddress);
|
||||
|
||||
WebSocket webSocket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false);
|
||||
|
||||
@@ -536,11 +536,11 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
WebSocketConnected?.Invoke(this, new GenericEventArgs<IWebSocketConnection>(connection));
|
||||
|
||||
await connection.ProcessAsync().ConfigureAwait(false);
|
||||
_logger.LogInformation("WS closed from {IP}", context.Connection.RemoteIpAddress);
|
||||
_logger.LogInformation("WS {IP} closed", context.Connection.RemoteIpAddress);
|
||||
}
|
||||
catch (Exception ex) // Otherwise ASP.Net will ignore the exception
|
||||
{
|
||||
_logger.LogError(ex, "WebSocketRequestHandler error");
|
||||
_logger.LogError(ex, "WS {IP} WebSocketRequestHandler error");
|
||||
if (!context.Response.HasStarted)
|
||||
{
|
||||
context.Response.StatusCode = 500;
|
||||
@@ -705,8 +705,6 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
_logger.LogDebug("Websocket message received: {0}", result.MessageType);
|
||||
|
||||
IEnumerable<Task> GetTasks()
|
||||
{
|
||||
foreach (var x in _webSocketListeners)
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
// Tell the PipeReader how much of the buffer we have consumed
|
||||
reader.AdvanceTo(buffer.End);
|
||||
|
||||
_logger.LogDebug("WS received message: {@Message}", stub);
|
||||
_logger.LogDebug("WS {IP} received message: {@Message}", RemoteEndPoint, stub);
|
||||
|
||||
var info = new WebSocketMessageInfo
|
||||
{
|
||||
@@ -204,7 +204,7 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
Connection = this
|
||||
};
|
||||
|
||||
_logger.LogDebug("WS message info: {@MessageInfo}", info);
|
||||
_logger.LogDebug("WS {IP} message info: {@MessageInfo}", RemoteEndPoint, info);
|
||||
|
||||
await OnReceive(info).ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user