From c6a09cc9fce42323d86d2f4e161a894cdc970a24 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 16 Apr 2025 14:51:36 -0500 Subject: T7363: track process id in session data In practice, this may be passed in the request as the ppid, as needed for CLI applications to coordinate with the ambient config session. For other uses, the client pid will suffice. --- src/vyconf_client.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vyconf_client.ml') diff --git a/src/vyconf_client.ml b/src/vyconf_client.ml index c4811c5..9971f8f 100644 --- a/src/vyconf_client.ml +++ b/src/vyconf_client.ml @@ -53,10 +53,10 @@ let prompt client = let%lwt resp = do_request client req in Lwt.return resp -let setup_session ?(on_behalf_of=None) client client_app = +let setup_session ?(on_behalf_of=None) client client_app pid = if Option.is_some client.session then Lwt.return (Error "Client is already associated with a session") else let id = on_behalf_of |> (function None -> None | Some x -> (Some (Int32.of_int x))) in - let req = Setup_session {client_application=(Some client_app); on_behalf_of=id} in + let req = Setup_session {client_application=(Some client_app); on_behalf_of=id; client_pid=pid} in let%lwt resp = do_request client req in match resp.status with | Success -> -- cgit v1.2.3