aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/FileWriter.cs
diff options
context:
space:
mode:
authorLuke Foust <luke@foust.com>2020-03-20 12:53:52 -0700
committerGitHub <noreply@github.com>2020-03-20 12:53:52 -0700
commitdcd0d93f44bf1befea5e61993bc868b5846102a0 (patch)
tree740f132fce52947fc8a73621588ca36c3447922a /Emby.Server.Implementations/HttpServer/FileWriter.cs
parent80dfc78ba5ec3895fd374a5bd761d0d0e9e6a862 (diff)
parente028fb6fdefa6120fc6109c63d883d21412c31bd (diff)
Merge pull request #1 from jellyfin/master
merge with upstream master
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/FileWriter.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/FileWriter.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/HttpServer/FileWriter.cs b/Emby.Server.Implementations/HttpServer/FileWriter.cs
index c1c8c3eb3..82f1e5b52 100644
--- a/Emby.Server.Implementations/HttpServer/FileWriter.cs
+++ b/Emby.Server.Implementations/HttpServer/FileWriter.cs
@@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.HttpServer
SetRangeValues();
}
- FileShare = FileShareMode.Read;
+ FileShare = FileShare.Read;
Cookies = new List<Cookie>();
}
@@ -93,7 +93,7 @@ namespace Emby.Server.Implementations.HttpServer
public List<Cookie> Cookies { get; private set; }
- public FileShareMode FileShare { get; set; }
+ public FileShare FileShare { get; set; }
/// <summary>
/// Gets the options.
@@ -221,17 +221,17 @@ namespace Emby.Server.Implementations.HttpServer
}
}
- public async Task TransmitFile(Stream stream, string path, long offset, long count, FileShareMode fileShareMode, CancellationToken cancellationToken)
+ public async Task TransmitFile(Stream stream, string path, long offset, long count, FileShare fileShare, CancellationToken cancellationToken)
{
- var fileOpenOptions = FileOpenOptions.SequentialScan;
+ var fileOptions = FileOptions.SequentialScan;
// use non-async filestream along with read due to https://github.com/dotnet/corefx/issues/6039
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- fileOpenOptions |= FileOpenOptions.Asynchronous;
+ fileOptions |= FileOptions.Asynchronous;
}
- using (var fs = _fileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, fileShareMode, fileOpenOptions))
+ using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read, fileShare, IODefaults.FileStreamBufferSize, fileOptions))
{
if (offset > 0)
{
@@ -244,7 +244,7 @@ namespace Emby.Server.Implementations.HttpServer
}
else
{
- await fs.CopyToAsync(stream, StreamDefaults.DefaultCopyToBufferSize, cancellationToken).ConfigureAwait(false);
+ await fs.CopyToAsync(stream, IODefaults.CopyToBufferSize, cancellationToken).ConfigureAwait(false);
}
}
}