FreeCalypso > hg > themwi-system-sw
diff mncc/extsock.c @ 28:660126bd5f59
themwi-mncc: fix one bug, add debug syslog output
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 28 Jun 2022 21:47:04 -0800 |
parents | c6572f4c31d2 |
children |
line wrap: on
line diff
--- a/mncc/extsock.c Tue Jun 28 19:21:51 2022 -0800 +++ b/mncc/extsock.c Tue Jun 28 21:47:04 2022 -0800 @@ -17,6 +17,8 @@ #include "struct.h" #include "gsm_call.h" +extern char *mncc_msg_name(); + void extsock_dec_refcount(conn) struct socket_conn *conn; @@ -52,6 +54,9 @@ if (call->gc_flag) continue; if (call->socket == conn) { + syslog(LOG_WARNING, + "clearing broken socket call: GSM callref 0x%x, socket ref 0x%x", + call->callref, call->socket_ref); send_rel_on_broken_socket(call); extsock_dec_refcount(conn); call->gc_flag = 1; @@ -85,6 +90,8 @@ report_runt(msg); return; } + syslog(LOG_DEBUG, "Rx MNCC_SETUP_REQ from socket, callref=0x%x", + msg->callref); call = find_socket_call(conn, msg->callref); if (call) { syslog(LOG_ERR, @@ -109,6 +116,8 @@ report_runt(msg); return; } + syslog(LOG_DEBUG, "Rx %s from socket, callref=0x%x", + mncc_msg_name(msg->msg_type), msg->callref); call = find_socket_call(conn, msg->callref); if (!call) { syslog(LOG_ERR, @@ -138,6 +147,8 @@ report_runt(msg); return; } + syslog(LOG_DEBUG, "Rx %s from socket, callref=0x%x", + mncc_msg_name(msg->msg_type), msg->callref); call = find_socket_call(conn, msg->callref); if (!call) { syslog(LOG_ERR, @@ -160,8 +171,11 @@ rc = recv(conn->fd, &msg, sizeof msg, 0); if (rc < 4) { - if (conn->ncalls) + if (conn->ncalls) { + syslog(LOG_ERR, "ext socket broken with calls present"); broken_socket_clear_calls(conn); + } else + syslog(LOG_INFO, "normal closing of ext socket"); close(conn->fd); conn->fd = -1; return;