summaryrefslogtreecommitdiff
path: root/src/vyconfd.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-10-23 18:50:46 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-10-27 21:47:40 -0500
commita5473033fc8ea92891d6ebab9bdeaccbe742d565 (patch)
tree29b2b3b19e9b9392878b24e106cc657de8589d6f /src/vyconfd.ml
parent73652e2bfc8a785e9b3dc447e0a0ced4716549e3 (diff)
downloadvyconf-a5473033fc8ea92891d6ebab9bdeaccbe742d565.tar.gz
vyconf-a5473033fc8ea92891d6ebab9bdeaccbe742d565.zip
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.
Diffstat (limited to 'src/vyconfd.ml')
-rw-r--r--src/vyconfd.ml6
1 files changed, 3 insertions, 3 deletions
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