aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs')
-rw-r--r--Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
index 801026c54..999e08384 100644
--- a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
+++ b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs
@@ -67,38 +67,40 @@ namespace Jellyfin.Server.Infrastructure
}
/// <inheritdoc />
- protected override Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength)
+ protected override async Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength)
{
ArgumentNullException.ThrowIfNull(context);
ArgumentNullException.ThrowIfNull(result);
if (range is not null && rangeLength == 0)
{
- return Task.CompletedTask;
+ return;
}
// It's a bit of wasted IO to perform this check again, but non-symlinks shouldn't use this code
if (!IsSymLink(result.FileName))
{
- return base.WriteFileAsync(context, result, range, rangeLength);
+ await base.WriteFileAsync(context, result, range, rangeLength).ConfigureAwait(false);
+ return;
}
var response = context.HttpContext.Response;
if (range is not null)
{
- return SendFileAsync(
+ await SendFileAsync(
result.FileName,
response,
offset: range.From ?? 0L,
- count: rangeLength);
+ count: rangeLength).ConfigureAwait(false);
+ return;
}
- return SendFileAsync(
+ await SendFileAsync(
result.FileName,
response,
offset: 0,
- count: null);
+ count: null).ConfigureAwait(false);
}
private async Task SendFileAsync(string filePath, HttpResponse response, long offset, long? count)