From 29e2798ec588c3503a0c1c2828fa371da529995a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 22 Dec 2017 16:47:18 +0100 Subject: control_if: Log the disconnect of a CTRL client We are logging new CTRL connections at LOGL_INFO, so we should also log disconnects for symmetry. Change-Id: Id30aa76a5a3dab32d6b4121ce6fdf56d71dfc2ba --- src/ctrl/control_if.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ctrl') diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index 6293ff52..a4382fa1 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -168,6 +168,10 @@ struct ctrl_cmd *ctrl_cmd_trap(struct ctrl_cmd *cmd) static void control_close_conn(struct ctrl_connection *ccon) { struct ctrl_cmd_def *cd, *cd2; + char *name = osmo_sock_get_name(ccon, ccon->write_queue.bfd.fd); + + LOGP(DLCTRL, LOGL_INFO, "close()d CTRL connection %s\n", name); + talloc_free(name); osmo_wqueue_clear(&ccon->write_queue); close(ccon->write_queue.bfd.fd); @@ -340,7 +344,6 @@ static int handle_control_read(struct osmo_fd * bfd) return 0; /* msg was already discarded. */ if (ret == 0) { - LOGP(DLCTRL, LOGL_INFO, "The control connection was closed\n"); control_close_conn(ccon); ret = -EIO; } -- cgit v1.2.3