r3783 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src/phone-kit

chris at sita.openmoko.org chris at sita.openmoko.org
Mon Jan 7 16:56:59 CET 2008


Author: chris
Date: 2008-01-07 16:56:58 +0100 (Mon, 07 Jan 2008)
New Revision: 3783

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
Log:
        * src/phone-kit/moko-network.c: (stop_retrying),
        (on_network_registered), (moko_network_dispose):
        Fix possible infinite retrying(?), increase time-out to 15 seconds


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2008-01-07 15:48:27 UTC (rev 3782)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2008-01-07 15:56:58 UTC (rev 3783)
@@ -1,5 +1,11 @@
 2008-01-07  Chris Lord  <chris at openedhand.com>
 
+	* src/phone-kit/moko-network.c: (stop_retrying),
+	(on_network_registered), (moko_network_dispose):
+	Fix possible infinite retrying(?), increase time-out to 15 seconds
+
+2008-01-07  Chris Lord  <chris at openedhand.com>
+
 	* src/phone-kit/moko-sms.c: (on_incoming_ds):
 	Don't check the stat of the delivery report, no need as we have the ref
 	anyway and I must be misinterpreting its meaning. Also switch around a

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c	2008-01-07 15:48:27 UTC (rev 3782)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-network.c	2008-01-07 15:56:58 UTC (rev 3783)
@@ -128,6 +128,24 @@
   return TRUE;
 }
 
+static void
+stop_retrying (MokoNetwork *network)
+{
+  /* Stop trying to get details */
+  if (network->priv->retry_oper) {
+    g_source_remove (network->priv->retry_oper);
+    network->priv->retry_oper = 0;
+  }
+  if (network->priv->retry_opers) {
+    g_source_remove (network->priv->retry_opers);
+    network->priv->retry_opers = 0;
+  }
+  if (network->priv->retry_imsi) {
+    g_source_remove (network->priv->retry_imsi);
+    network->priv->retry_imsi = 0;
+  }
+}
+
 /* Callbacks for gsmd events */
 static void
 on_network_registered (MokoListener *listener,
@@ -151,18 +169,7 @@
       priv->lac = 0;
       
       /* Stop trying to get details */
-      if (priv->retry_oper) {
-        g_source_remove (priv->retry_oper);
-        priv->retry_oper = 0;
-      }
-      if (priv->retry_opers) {
-        g_source_remove (priv->retry_opers);
-        priv->retry_opers = 0;
-      }
-      if (priv->retry_imsi) {
-        g_source_remove (priv->retry_imsi);
-        priv->retry_imsi = 0;
-      }
+      stop_retrying (MOKO_NETWORK (listener));
       
       break;
     case GSMD_NETREG_DENIED:
@@ -186,14 +193,14 @@
         lgsm_get_imsi (handle);
         
         /* Add a time-out in case retrieval fails - retry every 10 seconds */
-        while (g_source_remove_by_user_data (listener));
-        priv->retry_oper = g_timeout_add_seconds (10,
+        stop_retrying (MOKO_NETWORK (listener));
+        priv->retry_oper = g_timeout_add_seconds (15,
                                                   (GSourceFunc)retry_oper_get,
                                                   listener);
-        priv->retry_opers = g_timeout_add_seconds (10,
+        priv->retry_opers = g_timeout_add_seconds (15,
                                                    (GSourceFunc)retry_opers_get,
                                                    listener);
-        priv->retry_imsi = g_timeout_add_seconds (10,
+        priv->retry_imsi = g_timeout_add_seconds (15,
                                                   (GSourceFunc)retry_get_imsi,
                                                   listener);
       }
@@ -306,18 +313,7 @@
   network = MOKO_NETWORK (object);
   priv = network->priv;
 
-  if (priv->retry_oper) {
-    g_source_remove (priv->retry_oper);
-    priv->retry_oper = 0;
-  }
-  if (priv->retry_opers) {
-    g_source_remove (priv->retry_opers);
-    priv->retry_opers = 0;
-  }
-  if (priv->retry_imsi) {
-    g_source_remove (priv->retry_imsi);
-    priv->retry_imsi = 0;
-  }
+  stop_retrying (MOKO_NETWORK (object));
 
   if (priv->handle) {
     lgsm_exit (priv->handle);





More information about the commitlog mailing list