From 82f8451c10c2ab1cf9365969238dfb89a4d721f2 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 9 Apr 2013 19:09:54 +0200 Subject: [PATCH] modem-manager: wait up to 120s for the connection result We will very likely get the result of the connection attempt before the 2 mins, either successful or error, but still we need to explicitly ask to keep the DBus call open enough time. This time should be enough to handle both the connection time (usually around 60s max), plus the time needed to register in the network and all the other Simple.Connect() steps. --- src/modem-manager/nm-modem-broadband.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modem-manager/nm-modem-broadband.c b/src/modem-manager/nm-modem-broadband.c index 3d38cbae34..d84f31ff5c 100644 --- a/src/modem-manager/nm-modem-broadband.c +++ b/src/modem-manager/nm-modem-broadband.c @@ -57,6 +57,9 @@ enum { #define MODEM_CAPS_3GPP2(caps) (caps & (MM_MODEM_CAPABILITY_CDMA_EVDO)) +/* Maximum time to keep the DBus call waiting for a connection result */ +#define MODEM_CONNECT_TIMEOUT_SECS 120 + /*****************************************************************************/ #define NM_MODEM_BROADBAND_ERROR (nm_modem_broadband_error_quark ()) @@ -360,6 +363,7 @@ act_stage1_prepare (NMModem *_self, if (!self->priv->simple_iface) self->priv->simple_iface = mm_object_get_modem_simple (self->priv->modem_object); + g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (self->priv->simple_iface), MODEM_CONNECT_TIMEOUT_SECS * 1000); mm_modem_simple_connect (self->priv->simple_iface, self->priv->connect_properties, NULL,