on master help sign in
Fix sendToEach missing recursion and safeCompareLoop timing leak
commit2cefad750ee6496b16b87d5fe04a25c6a9d248f1 authoriko <mail@iko.soy> dateWed 8 Apr 2026, 01:27 (6 months ago) parent2f6cb27
3 files changed+7−5
client/obj/Debug/net10.0-maccatalyst/maccatalyst-arm64/Skrepka.AssemblyInfo.fs+1−1 client/obj/Debug/net10.0-maccatalyst/maccatalyst-arm64/Skrepka.AssemblyInfoInputs.cache+1−1 server.knot+5−3
client/obj/Debug/net10.0-maccatalyst/maccatalyst-arm64/Skrepka.AssemblyInfo.fs+1−1
@@ -10,7 +10,7 @@ open System.Reflection
1010[<assembly: System.Reflection.AssemblyCompanyAttribute("Skrepka")>]
1111[<assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")>]
1212[<assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")>]
13−[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0+35cfa8dd8a7ec31992248d54e4f0daad25059b35")>]
13+[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0+2f6cb274e3548f269ef50168e9ca9611a6d2557f")>]
1414[<assembly: System.Reflection.AssemblyProductAttribute("Skrepka")>]
1515[<assembly: System.Reflection.AssemblyTitleAttribute("Skrepka")>]
1616[<assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")>]
client/obj/Debug/net10.0-maccatalyst/maccatalyst-arm64/Skrepka.AssemblyInfoInputs.cache+1−1
@@ -1 +1 @@
1−f2e042884f0b886171f864543cde690210be3d94499524579f9eff0fb81257c7
1+68a8262e6467a5e524d43f188e41c936a909d384199e15f22537454f26fb6a62
server.knot+5−3
@@ -391,8 +391,8 @@ evictOldestAckedIds = \items n ->
391391 in diff items toEvict
392392
393393safeCompareLoop = \s1 s2 n result ->
394− if n <= 0 && s1 == "" && s2 == ""
395− then result
394+ if n <= 0
395+ then result + (if s1 == "" then 0 else 1) + (if s2 == "" then 0 else 1)
396396 else safeCompareLoop (drop 1 s1) (drop 1 s2) (n - 1) (result + (if take 1 s1 == take 1 s2 then 0 else 1))
397397
398398safeCompare = \a b ->
@@ -407,7 +407,9 @@ sendToEach = \servers action ->
407407 let rest = do s <- servers; where not (s == server); yield s
408408 if server == ""
409409 then yield {}
410− else action server
410+ else do
411+ action server
412+ sendToEach rest action
411413
412414pruneExpired = \t -> do
413415 challenges <- *challenges