mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-05 00:31:51 +03:00
Fix logger CA2024: Do not use StreamReader.EndOfStream in async methods
This commit is contained in:
@@ -27,10 +27,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
using (target)
|
||||
using (reader)
|
||||
{
|
||||
while (!reader.EndOfStream && reader.BaseStream.CanRead)
|
||||
string? line = await reader.ReadLineAsync().ConfigureAwait(false);
|
||||
while (line is not null && reader.BaseStream.CanRead)
|
||||
{
|
||||
var line = await reader.ReadLineAsync().ConfigureAwait(false);
|
||||
|
||||
ParseLogLine(line, state);
|
||||
|
||||
var bytes = Encoding.UTF8.GetBytes(Environment.NewLine + line);
|
||||
@@ -50,6 +49,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
await target.FlushAsync().ConfigureAwait(false);
|
||||
line = await reader.ReadLineAsync().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user