fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/28864 )
Change subject: trxcon: improve L1CTL connection related logging ......................................................................
trxcon: improve L1CTL connection related logging
* l1ctl_client_conn_close(): log "Closing L1CTL connection"; * l1ctl_client_read_cb(): more precise logging, use strerror().
Change-Id: Ie932513f93fd7f1a5f5e70f4d78235551f7599c8 Related: OS#5599 --- M src/host/trxcon/src/l1ctl_server.c 1 file changed, 14 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/64/28864/1
diff --git a/src/host/trxcon/src/l1ctl_server.c b/src/host/trxcon/src/l1ctl_server.c index cf98c6f..f9d34fa 100644 --- a/src/host/trxcon/src/l1ctl_server.c +++ b/src/host/trxcon/src/l1ctl_server.c @@ -50,12 +50,19 @@
/* Attempt to read from socket */ rc = read(ofd->fd, &len, L1CTL_MSG_LEN_FIELD); - if (rc < L1CTL_MSG_LEN_FIELD) { - LOGP_CLI(client, DL1D, LOGL_NOTICE, - "L1CTL server has lost connection (id=%u)\n", - client->id); - if (rc >= 0) + if (rc != L1CTL_MSG_LEN_FIELD) { + if (rc == 0) { + LOGP_CLI(client, DL1D, LOGL_NOTICE, + "L1CTL connection closed by remote peer\n"); + } else if (rc < 0) { + LOGP_CLI(client, DL1D, LOGL_NOTICE, + "L1CTL connection error (rc=%d): %s\n", + rc, strerror(errno)); + } else { + LOGP_CLI(client, DL1D, LOGL_NOTICE, + "L1CTL connection error: short read\n"); rc = -EIO; + } l1ctl_client_conn_close(client); return rc; } @@ -199,6 +206,8 @@ { struct l1ctl_server *server = client->server;
+ LOGP_CLI(client, DL1C, LOGL_NOTICE, "Closing L1CTL connection\n"); + if (server->cfg->conn_close_cb != NULL) server->cfg->conn_close_cb(client);