Remove unused Brotli compressor

pull/1010/head
Claus Vium 5 years ago
parent 51648a2a21
commit bc00617df7

@ -741,7 +741,7 @@ namespace Emby.Server.Implementations
ZipClient = new ZipClient(); ZipClient = new ZipClient();
serviceCollection.AddSingleton(ZipClient); serviceCollection.AddSingleton(ZipClient);
HttpResultFactory = new HttpResultFactory(LoggerFactory, FileSystemManager, JsonSerializer, CreateBrotliCompressor()); HttpResultFactory = new HttpResultFactory(LoggerFactory, FileSystemManager, JsonSerializer);
serviceCollection.AddSingleton(HttpResultFactory); serviceCollection.AddSingleton(HttpResultFactory);
serviceCollection.AddSingleton<IServerApplicationHost>(this); serviceCollection.AddSingleton<IServerApplicationHost>(this);
@ -896,11 +896,6 @@ namespace Emby.Server.Implementations
_serviceProvider = serviceCollection.BuildServiceProvider(); _serviceProvider = serviceCollection.BuildServiceProvider();
} }
protected virtual IBrotliCompressor CreateBrotliCompressor()
{
return null;
}
public virtual string PackageRuntime => "netcore"; public virtual string PackageRuntime => "netcore";
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, EnvironmentInfo.EnvironmentInfo environmentInfo) public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, EnvironmentInfo.EnvironmentInfo environmentInfo)

@ -35,16 +35,13 @@ namespace Emby.Server.Implementations.HttpServer
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
private readonly IJsonSerializer _jsonSerializer; private readonly IJsonSerializer _jsonSerializer;
private IBrotliCompressor _brotliCompressor;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="HttpResultFactory" /> class. /// Initializes a new instance of the <see cref="HttpResultFactory" /> class.
/// </summary> /// </summary>
public HttpResultFactory(ILoggerFactory loggerfactory, IFileSystem fileSystem, IJsonSerializer jsonSerializer, IBrotliCompressor brotliCompressor) public HttpResultFactory(ILoggerFactory loggerfactory, IFileSystem fileSystem, IJsonSerializer jsonSerializer)
{ {
_fileSystem = fileSystem; _fileSystem = fileSystem;
_jsonSerializer = jsonSerializer; _jsonSerializer = jsonSerializer;
_brotliCompressor = brotliCompressor;
_logger = loggerfactory.CreateLogger("HttpResultFactory"); _logger = loggerfactory.CreateLogger("HttpResultFactory");
} }
@ -350,11 +347,6 @@ namespace Emby.Server.Implementations.HttpServer
private byte[] Compress(byte[] bytes, string compressionType) private byte[] Compress(byte[] bytes, string compressionType)
{ {
if (string.Equals(compressionType, "br", StringComparison.OrdinalIgnoreCase))
{
return CompressBrotli(bytes);
}
if (string.Equals(compressionType, "deflate", StringComparison.OrdinalIgnoreCase)) if (string.Equals(compressionType, "deflate", StringComparison.OrdinalIgnoreCase))
{ {
return Deflate(bytes); return Deflate(bytes);
@ -368,11 +360,6 @@ namespace Emby.Server.Implementations.HttpServer
throw new NotSupportedException(compressionType); throw new NotSupportedException(compressionType);
} }
private byte[] CompressBrotli(byte[] bytes)
{
return _brotliCompressor.Compress(bytes);
}
private static byte[] Deflate(byte[] bytes) private static byte[] Deflate(byte[] bytes)
{ {
// In .NET FX incompat-ville, you can't access compressed bytes without closing DeflateStream // In .NET FX incompat-ville, you can't access compressed bytes without closing DeflateStream

Loading…
Cancel
Save