diff options
author | Dan Williams <dcbw@redhat.com> | 2010-03-12 12:21:29 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-03-12 12:21:29 -0800 |
commit | 9d91501330514d8bbd83c8f729ec5231e862e226 (patch) | |
tree | 3c6e71d945a228983af891ad9270514c4e6607e3 /plugins/mm-modem-hso.c | |
parent | 4d1e00c49610b69b2446562880bef4f82b18d546 (diff) | |
parent | 7aa6d03d95dcf7677a576ac5c562c04d75cffa06 (diff) |
Merge remote branch 'origin/master' into qcdm
Diffstat (limited to 'plugins/mm-modem-hso.c')
-rw-r--r-- | plugins/mm-modem-hso.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/mm-modem-hso.c b/plugins/mm-modem-hso.c index 4fe6fd03..8a7ffdbb 100644 --- a/plugins/mm-modem-hso.c +++ b/plugins/mm-modem-hso.c @@ -141,8 +141,10 @@ _internal_hso_modem_authenticate (MMModemHso *self, MMCallbackInfo *info) g_assert (primary); cid = hso_get_cid (self); + g_warn_if_fail (cid >= 0); - if (!priv->username && !priv->password) + /* Both user and password are required; otherwise firmware returns an error */ + if (!priv->username || !priv->password) command = g_strdup_printf ("%s=%d,0", auth_commands[priv->auth_idx], cid); else { command = g_strdup_printf ("%s=%d,1,\"%s\",\"%s\"", @@ -367,14 +369,13 @@ do_connect (MMModem *modem, gpointer user_data) { MMModemHso *self = MM_MODEM_HSO (modem); - MMModemHsoPrivate *priv = MM_MODEM_HSO_GET_PRIVATE (self); - MMCallbackInfo *info; + MMCallbackInfo *auth_info, *connect_info; mm_modem_set_state (modem, MM_MODEM_STATE_CONNECTING, MM_MODEM_STATE_REASON_NONE); - info = mm_callback_info_new (modem, callback, user_data); - - mm_hso_modem_authenticate (self, priv->username, priv->password, connect_auth_done, info); + connect_info = mm_callback_info_new (modem, callback, user_data); + auth_info = mm_callback_info_new (modem, connect_auth_done, connect_info); + _internal_hso_modem_authenticate (self, auth_info); } /*****************************************************************************/ |