From a5473033fc8ea92891d6ebab9bdeaccbe742d565 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 23 Oct 2024 18:50:46 -0500 Subject: T6718: fix teardown method An empty protobuf message does not correctly generate encode/decode functions. This appears to be fixed upstream, but for now, use workaround of adding a reasonable field. --- src/vyconfd.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vyconfd.ml') diff --git a/src/vyconfd.ml b/src/vyconfd.ml index 2bb3253..a445864 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -84,10 +84,10 @@ let exit_conf_mode world token = in Hashtbl.replace sessions token session; response_tmpl -let teardown_session token = +let teardown token = try Hashtbl.remove sessions token; - response_tmpl + {response_tmpl with status=Success} with Not_found -> {response_tmpl with status=Fail; error=(Some "Session not found")} @@ -168,7 +168,7 @@ let rec handle_connection world ic oc fd () = | _, Status -> response_tmpl | _, Setup_session r -> setup_session world r | None, _ -> {response_tmpl with status=Fail; output=(Some "Operation requires session token")} - | Some t, Teardown _ -> teardown_session t + | Some t, Teardown _ -> teardown t | Some t, Configure r -> enter_conf_mode r t | Some t, Exit_configure -> exit_conf_mode world t | Some t, Exists r -> exists world t r -- cgit v1.2.3