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 a5117b6..960e523 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -163,6 +163,14 @@ let delete world token (req: request_delete) = response_tmpl with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} +let load world token (req: request_load) = + try + let session = Session.load world (find_session token) req.location + in + Hashtbl.replace sessions token session; + response_tmpl + with Session.Session_error msg -> {response_tmpl with status=Fail; error=(Some msg)} + let commit world token (req: request_commit) = let s = find_session token in let at = world.Session.running_config in @@ -251,6 +259,7 @@ let rec handle_connection world ic oc () = | Some t, Validate r -> validate world t r | Some t, Set r -> set world t r | Some t, Delete r -> delete world t r + | Some t, Load r -> load world t r | _ -> failwith "Unimplemented" ) |> Lwt.return end |