Skip to content

Commit e90a901

Browse files
committed
stunnel_cache: use timestamps for cache evictions instead of IDs
It's surprising this bug went unnoticed Signed-off-by: Pau Ruiz Safont <pau.safont@vates.tech>
1 parent 30009f7 commit e90a901

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)