summaryrefslogtreecommitdiffstats
path: root/src/ctrl
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-22 16:47:18 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-22 18:05:45 +0100
commit29e2798ec588c3503a0c1c2828fa371da529995a (patch)
treebf99e3ee2af8da565ae4f979fb522b291b72894a /src/ctrl
parentf360b42ca11bdad01036b95ca1983533ed35c542 (diff)
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
Diffstat (limited to 'src/ctrl')
-rw-r--r--src/ctrl/control_if.c5
1 files changed, 4 insertions, 1 deletions
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;
}