diff options
Diffstat (limited to 'src/vyconfd.ml')
| -rw-r--r-- | src/vyconfd.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml index 379a55e..a0be019 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -223,6 +223,14 @@ let load world token (req: request_load) = response_tmpl with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} +let merge world token (req: request_merge) = + try + let session = Session.merge world (find_session token) req.location req.destructive + in + Hashtbl.replace sessions token session; + response_tmpl + with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} + let save world token (req: request_save) = try let _ = Session.save world (find_session token) req.location @@ -319,6 +327,7 @@ let rec handle_connection world ic oc () = | Some t, Session_changed r -> session_changed world t r | Some t, Get_config r -> get_config world t r | Some t, Load r -> load world t r + | Some t, Merge r -> merge world t r | Some t, Save r -> save world t r | _ -> failwith "Unimplemented" ) |> Lwt.return |
