mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-05 08:42:50 +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 (target)
|
||||||
using (reader)
|
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);
|
ParseLogLine(line, state);
|
||||||
|
|
||||||
var bytes = Encoding.UTF8.GetBytes(Environment.NewLine + line);
|
var bytes = Encoding.UTF8.GetBytes(Environment.NewLine + line);
|
||||||
@@ -50,6 +49,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
}
|
}
|
||||||
|
|
||||||
await target.FlushAsync().ConfigureAwait(false);
|
await target.FlushAsync().ConfigureAwait(false);
|
||||||
|
line = await reader.ReadLineAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user