aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 10:56:15 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-26 08:41:52 +0100
commit37184900e7f4f8566fbd71914f55b3cc8c0196e9 (patch)
treebe8bd36badf9e0ec630efda748ce83e002220059 /openbsc
parent9d1a17e15f6902bc9591680da3375b2d14db16ab (diff)
gprs: Return 0 from gsup_client_connect if ok or retry timer enabled
Currently the gsup_client_connect return 0 if the call to ipa_client_conn_open was successful and -errno otherwise. This makes it difficult for the caller to determine, whether the the whole operation has been cancelled (currently on EBADF, ENOTSOCK, EAFNOSUPPORT, EINVAL) or whether the GSUP client will retry to connect after a timeout. This will cause gprs_gsup_client_create to destroy the GSUP client object, even if the error might be temporary. This patch changes the function to return 0 if (and only if) ipa_client_conn_open was successful or the retry timer has been started. Since the return value 0 doesn't guarantee, that a subsequent call to gprs_gsup_client_send will succeed, this shouldn't break anything. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gprs_gsup_client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_gsup_client.c b/openbsc/src/gprs/gprs_gsup_client.c
index 523c541b7..f6e18c9fe 100644
--- a/openbsc/src/gprs/gprs_gsup_client.c
+++ b/openbsc/src/gprs/gprs_gsup_client.c
@@ -84,7 +84,10 @@ static int gsup_client_connect(struct gprs_gsup_client *gsupc)
osmo_timer_schedule(&gsupc->connect_timer, GPRS_GSUP_RECONNECT_INTERVAL, 0);
- return rc;
+ LOGP(DGPRS, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n",
+ gsupc->link->addr, gsupc->link->port);
+
+ return 0;
}
static void connect_timer_cb(void *gsupc_)