pespin submitted this change.
asp: Log close&reconnect triggered from stream
This helps a lot in debugging the cascade of events happening when
something goes wrong, since the xua_cli_close_and_reconnect() is called
from several places.
Change-Id: I05ffa0b21ad7b694899982901d9b94bdcf4e7999
---
M src/osmo_ss7_asp.c
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index d81d25c..44ffa68 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -609,6 +609,7 @@
static int ipa_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg);
static int m3ua_tcp_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg);
static int xua_cli_connect_cb(struct osmo_stream_cli *cli);
+static int xua_cli_disconnect_cb(struct osmo_stream_cli *cli);
static int xua_cli_close_and_reconnect(struct osmo_stream_cli *cli);
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp)
@@ -647,7 +648,7 @@
osmo_stream_cli_set_proto(asp->client, asp->cfg.trans_proto);
osmo_stream_cli_set_reconnect_timeout(asp->client, 5);
osmo_stream_cli_set_connect_cb(asp->client, xua_cli_connect_cb);
- osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_close_and_reconnect);
+ osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_disconnect_cb);
switch (asp->cfg.proto) {
case OSMO_SS7_ASP_PROT_IPA:
OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_TCP);
@@ -980,6 +981,14 @@
return 0;
}
+static int xua_cli_disconnect_cb(struct osmo_stream_cli *cli)
+{
+ struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(cli);
+ LOGPASP(asp, DLSS7, LOGL_NOTICE, "disconnect_cb() from lower layers, reconnecting\n");
+ xua_cli_close_and_reconnect(cli);
+ return 0;
+}
+
/* read call-back for IPA/SCCPlite socket */
static int ipa_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg)
{
To view, visit change 39632. To unsubscribe, or for help writing mail filters, visit settings.