From b0ad40decaa02d187a77a9374130198123fea158 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 10 Jan 2025 01:14:49 +0900 Subject: [PATCH] fixed minor bugs including wrong message output and mssing log messages --- client-ctl.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client-ctl.go b/client-ctl.go index fa07f54..974894a 100644 --- a/client-ctl.go +++ b/client-ctl.go @@ -515,7 +515,7 @@ func (ctl *client_ctl_client_conns_id_routes_id) ServeHTTP(w http.ResponseWriter r = cts.FindClientRouteById(RouteId(route_nid)) if r == nil { status_code = http.StatusNotFound; w.WriteHeader(status_code) - if err = je.Encode(json_errmsg{Text: "non-existent route id - " + conn_id}); err != nil { goto oops } + if err = je.Encode(json_errmsg{Text: "non-existent route id - " + route_id}); err != nil { goto oops } goto done } @@ -555,7 +555,11 @@ func (ctl *client_ctl_client_conns_id_routes_id) ServeHTTP(w http.ResponseWriter } else { err = r.ResetLifetime(lifetime) } - if err != nil { goto oops } + if err != nil { + status_code = http.StatusForbidden; w.WriteHeader(status_code) + goto oops + } + status_code = http.StatusOK; w.WriteHeader(status_code) case http.MethodDelete: r.ReqStop() @@ -620,7 +624,7 @@ func (ctl *client_ctl_client_conns_id_routes_spsp) ServeHTTP(w http.ResponseWrit r = cts.FindClientRouteByServerPeerSvcPortId(PortId(port_nid)) if r == nil { status_code = http.StatusNotFound; w.WriteHeader(status_code) - if err = je.Encode(json_errmsg{Text: "non-existent route id - " + conn_id}); err != nil { goto oops } + if err = je.Encode(json_errmsg{Text: "non-existent server peer port id - " + port_id}); err != nil { goto oops } goto done }