diff options
author | John Estabrook <jestabro@vyos.io> | 2025-04-06 22:02:52 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2025-04-11 13:32:31 -0500 |
commit | b109872b5c29f401ecf059c7d763f14d8ed51134 (patch) | |
tree | 347b6bc11d0b006251a49af706d20c9edf30530c /src/vyconfd.ml | |
parent | 9e8feea52140222c689af1439eb7be63a9e121da (diff) | |
download | vyconf-b109872b5c29f401ecf059c7d763f14d8ed51134.tar.gz vyconf-b109872b5c29f401ecf059c7d763f14d8ed51134.zip |
T7321: add session_changed check
Diffstat (limited to 'src/vyconfd.ml')
-rw-r--r-- | src/vyconfd.ml | 5 |
1 files changed, 5 insertions, 0 deletions
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" |