From 9044750efd0ce98578dc863b67a5b6e9a11e16b2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 23 Jan 2016 13:21:35 -0500 Subject: [PATCH] update http compression --- .../Connect/ConnectEntryPoint.cs | 5 ++- .../EntryPoints/UsageReporter.cs | 36 ++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index af81b4eea..6dab136a5 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -66,7 +66,10 @@ namespace MediaBrowser.Server.Implementations.Connect { Url = ipLookupUrl, UserAgent = "Emby/" + _appHost.ApplicationVersion, - LogErrors = logErrors + LogErrors = logErrors, + + // Seeing block length errors with our server + EnableHttpCompression = false }).ConfigureAwait(false)) { diff --git a/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs b/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs index 5496bd9b2..be2817fd2 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/UsageReporter.cs @@ -28,7 +28,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints _logger = logger; } - public Task ReportServerUsage(CancellationToken cancellationToken) + public async Task ReportServerUsage(CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); @@ -51,10 +51,24 @@ namespace MediaBrowser.Server.Implementations.EntryPoints data["plugins"] = string.Join(",", _applicationHost.Plugins.Select(i => i.Id).ToArray()); - return _httpClient.Post(MbAdminUrl + "service/registration/ping", data, cancellationToken); + var options = new HttpRequestOptions + { + Url = MbAdminUrl + "service/registration/ping", + CancellationToken = cancellationToken, + + // Seeing block length errors + EnableHttpCompression = false + }; + + options.SetPostData(data); + + using (var response = await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)) + { + + } } - public Task ReportAppUsage(ClientInfo app, CancellationToken cancellationToken) + public async Task ReportAppUsage(ClientInfo app, CancellationToken cancellationToken) { if (string.IsNullOrWhiteSpace(app.DeviceId)) { @@ -79,7 +93,21 @@ namespace MediaBrowser.Server.Implementations.EntryPoints { "platform", app.DeviceName }, }; - return _httpClient.Post(MbAdminUrl + "service/registration/ping", data, cancellationToken); + var options = new HttpRequestOptions + { + Url = MbAdminUrl + "service/registration/ping", + CancellationToken = cancellationToken, + + // Seeing block length errors + EnableHttpCompression = false + }; + + options.SetPostData(data); + + using (var response = await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)) + { + + } } }