diff options
author | John Estabrook <jestabro@vyos.io> | 2024-10-23 18:50:46 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2024-10-27 21:47:40 -0500 |
commit | a5473033fc8ea92891d6ebab9bdeaccbe742d565 (patch) | |
tree | 29b2b3b19e9b9392878b24e106cc657de8589d6f /src/vyconfd.ml | |
parent | 73652e2bfc8a785e9b3dc447e0a0ced4716549e3 (diff) | |
download | vyconf-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.ml | 6 |
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 |