Skip to content

Commit c82312d

Browse files
committed
stunnel_cache: cache eviction uses ID for sorting, not timestamps
It's surprising this bug went unnoticed Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
1 parent 32185ad commit c82312d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ocaml/libs/stunnel/stunnel_cache.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ let unlocked_gc () =
125125
List.filter (fun (idx, _) -> not (List.mem idx !to_gc)) times'
126126
in
127127
(* Sort into descending order of donation time, ie youngest first *)
128-
let times' = List.sort (fun (x, _) (y, _) -> compare y x) times' in
128+
let times' = List.sort (fun (_, x) (_, y) -> Float.compare y x) times' in
129129
let oldest = list_drop max_stunnel times' in
130130
let oldest_ids = List.map fst oldest in
131131
List.iter

0 commit comments

Comments
 (0)