Change in osmocom-bb[master]: trxcon: improve L1CTL connection related logging
laforge has submitted this change. ( 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, 11 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/host/trxcon/src/l1ctl_server.c b/src/host/trxcon/src/l1ctl_server.c index cf98c6f..bfbd997 100644 --- a/src/host/trxcon/src/l1ctl_server.c +++ b/src/host/trxcon/src/l1ctl_server.c @@ -50,12 +50,16 @@ /* 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 error: read() failed (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 +203,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); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/28864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ie932513f93fd7f1a5f5e70f4d78235551f7599c8 Gerrit-Change-Number: 28864 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
laforge