From 487cd29d8bdae22af6c2ee897615279e92f77eb7 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 19 Jul 2012 10:41:50 +0200 Subject: [PATCH] hso: unsolicited %IPDPACT may come before the AT command reply --- plugins/option/mm-broadband-bearer-hso.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/option/mm-broadband-bearer-hso.c b/plugins/option/mm-broadband-bearer-hso.c index 491b4659..612177cc 100644 --- a/plugins/option/mm-broadband-bearer-hso.c +++ b/plugins/option/mm-broadband-bearer-hso.c @@ -468,10 +468,8 @@ activate_ready (MMBaseModem *modem, return; } - /* We will now setup a timeout and keep the context in the bearer's private. - * Reports of modem being connected will arrive via unsolicited messages. */ - g_assert (ctx->self->priv->connect_pending == NULL); - ctx->self->priv->connect_pending = ctx; + /* We will now setup a timeout so that we don't wait forever to get the + * connection on */ ctx->self->priv->connect_pending_id = g_timeout_add_seconds (30, (GSourceFunc)connect_timed_out_cb, ctx->self); @@ -516,6 +514,11 @@ authenticate_ready (MMBaseModem *modem, (GAsyncReadyCallback)activate_ready, ctx); g_free (command); + + /* We will now keep the context in the bearer's private. + * Reports of modem being connected will arrive via unsolicited messages. */ + g_assert (ctx->self->priv->connect_pending == NULL); + ctx->self->priv->connect_pending = ctx; } const gchar *auth_commands[] = {