From 9108b782d6376ba00aa449bbdff260de552f0810 Mon Sep 17 00:00:00 2001 From: AliveDevil Date: Tue, 2 Jan 2024 00:14:48 +0100 Subject: [PATCH] Csv handling - disables csFastFloat (unused, regardless) --- src/pdns-dhcp/Kea/KeaDhcpLeaseWatcher.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pdns-dhcp/Kea/KeaDhcpLeaseWatcher.cs b/src/pdns-dhcp/Kea/KeaDhcpLeaseWatcher.cs index 460a72c..fce2bd5 100644 --- a/src/pdns-dhcp/Kea/KeaDhcpLeaseWatcher.cs +++ b/src/pdns-dhcp/Kea/KeaDhcpLeaseWatcher.cs @@ -21,6 +21,11 @@ public sealed class KeaDhcpLeaseWatcher : IHostedService Options = FileOptions.SequentialScan | FileOptions.Asynchronous, Share = (FileShare)7, }; + private static readonly SepReaderOptions MemfileReader = Sep.New(',').Reader(o => o with + { + DisableColCountCheck = true, + DisableFastFloat = true + }); private readonly Decoder _decoder; private readonly FileSystemWatcher _fsw; @@ -165,11 +170,7 @@ public sealed class KeaDhcpLeaseWatcher : IHostedService { if (reader is null) { - reader = Sep.New(',').Reader(o => o with - { - DisableColCountCheck = true, - Unescape = false - }).From(_pipe.Reader.AsStream()); + reader = MemfileReader.From(_pipe.Reader.AsStream()); continue; } @@ -252,7 +253,6 @@ public sealed class KeaDhcpLeaseWatcher : IHostedService task.GetAwaiter().GetResult(); } - private void OnLeaseError(object sender, ErrorEventArgs e) { _eventChannel?.Writer.Complete(e.GetException());