diff options
| author | Bond-009 <bond.009@outlook.com> | 2025-01-28 11:29:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-28 11:29:46 +0100 |
| commit | 973489232205755abe16762c1e3446f2236349f2 (patch) | |
| tree | a5777cf5c4718bd3f9e75670e34cfef77e64243b /Jellyfin.Server/Infrastructure | |
| parent | bcdffa74a80972f8493837fa911c9628598f7fa3 (diff) | |
| parent | d2db7004024c6bbdd541a381c673f1e0b0aebfcb (diff) | |
Merge pull request #12925 from Bond-009/await
Always await instead of directly returning Task
Diffstat (limited to 'Jellyfin.Server/Infrastructure')
| -rw-r--r-- | Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs b/Jellyfin.Server/Infrastructure/SymlinkFollowingPhysicalFileResultExecutor.cs index 901ed55be6..910b5c4672 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, CancellationToken cancellationToken = default) |
