From b109872b5c29f401ecf059c7d763f14d8ed51134 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Sun, 6 Apr 2025 22:02:52 -0500 Subject: T7321: add session_changed check --- src/vyconfd.ml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/vyconfd.ml') diff --git a/src/vyconfd.ml b/src/vyconfd.ml index e37a6ae..885fd20 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -95,6 +95,10 @@ let teardown token = with Not_found -> {response_tmpl with status=Fail; error=(Some "Session not found")} +let session_changed world token (_req: request_session_changed) = + if Session.session_changed world (find_session token) then response_tmpl + else {response_tmpl with status=Fail} + let exists world token (req: request_exists) = if Session.exists world (find_session token) req.path then response_tmpl else {response_tmpl with status=Fail} @@ -275,6 +279,7 @@ let rec handle_connection world ic oc () = | Some t, Set r -> set world t r | Some t, Delete r -> delete world t r | Some t, Discard r -> discard world t r + | Some t, Session_changed r -> session_changed world t r | Some t, Load r -> load world t r | Some t, Save r -> save world t r | _ -> failwith "Unimplemented" -- cgit v1.2.3