summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/src/gprs/gprs_gsup_client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_gsup_client.c b/openbsc/src/gprs/gprs_gsup_client.c
index 52099005c..aaf301755 100644
--- a/openbsc/src/gprs/gprs_gsup_client.c
+++ b/openbsc/src/gprs/gprs_gsup_client.c
@@ -46,6 +46,9 @@ static int gsup_client_connect(struct gprs_gsup_client *gsupc)
osmo_timer_del(&gsupc->connect_timer);
}
+ if (ipa_client_conn_clear_queue(gsupc->link) > 0)
+ LOGP(DLINP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n");
+
rc = ipa_client_conn_open(gsupc->link);
if (rc >= 0)
@@ -181,6 +184,11 @@ int gprs_gsup_client_send(struct gprs_gsup_client *gsupc, struct msgb *msg)
return -ENOTCONN;
}
+ if (!gsupc->is_connected) {
+ msgb_free(msg);
+ return -EAGAIN;
+ }
+
ipa_prepend_header_ext(msg, IPAC_PROTO_EXT_GSUP);
ipa_msg_push_header(msg, IPAC_PROTO_OSMO);
ipa_client_conn_send(gsupc->link, msg);