aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpClientManager
diff options
context:
space:
mode:
authorWWWesten <wwwesten@gmail.com>2019-02-23 18:58:38 +0500
committerGitHub <noreply@github.com>2019-02-23 18:58:38 +0500
commitf2817fef743eeb75a00782ceea363b2d3e7dc9f2 (patch)
treea860fae2b10307eaa7b20293dc75600577167dea /Emby.Server.Implementations/HttpClientManager
parente7e7d96f5177fd9185aead256120d48c6324ffa1 (diff)
parentde45cfdd8c49cac2caeca994242513dad1082d59 (diff)
Merge pull request #1 from jellyfin/master
Merge from upstream
Diffstat (limited to 'Emby.Server.Implementations/HttpClientManager')
-rw-r--r--Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs17
1 files changed, 3 insertions, 14 deletions
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
index 2232b3eeb..2e0728136 100644
--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
@@ -539,21 +539,10 @@ namespace Emby.Server.Implementations.HttpClientManager
var contentLength = GetContentLength(httpResponse);
- if (contentLength.HasValue)
- {
- using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
- {
- await httpResponse.GetResponseStream().CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, options.CancellationToken).ConfigureAwait(false);
- }
- }
- else
+ using (var stream = httpResponse.GetResponseStream())
+ using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
{
- // We're not able to track progress
- using (var stream = httpResponse.GetResponseStream())
- using (var fs = _fileSystem.GetFileStream(tempFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read, true))
- {
- await stream.CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, options.CancellationToken).ConfigureAwait(false);
- }
+ await stream.CopyToAsync(fs, StreamDefaults.DefaultCopyToBufferSize, options.CancellationToken).ConfigureAwait(false);
}
options.Progress.Report(100);