Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/ChangeLog,v
retrieving revision 1.398
diff -u -p -r1.398 ChangeLog
--- ChangeLog	24 Aug 2005 22:18:13 -0000	1.398
+++ ChangeLog	24 Aug 2005 23:50:36 -0000
@@ -1,5 +1,13 @@
 2005-08-24  Ryan Lortie  <desrt@desrt.ca>
 
+	* gweather-applet.c (update_finish): Fix serious logic problem in
+	  failure-handling code and always reschedule timeout function -- not
+	  just in case of success.  Closes bug #309492.
+
+	  This patch largely based on the work of Pierre Ossman.
+
+2005-08-24  Ryan Lortie  <desrt@desrt.ca>
+
 	* Locations.xml.in: Removed broken duplicate Wildwood, New Jersey
 	  entry.  Patch from Chris Hollenbeck <chris.hollenbeck@gmail.com>
 	  closes bug #310043.
Index: gweather-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/gweather-applet.c,v
retrieving revision 1.96
diff -u -p -r1.96 gweather-applet.c
--- gweather-applet.c	10 Jul 2005 04:40:34 -0000	1.96
+++ gweather-applet.c	24 Aug 2005 23:50:37 -0000
@@ -432,15 +432,17 @@ void update_finish (WeatherInfo *info)
 #endif
     char *s;
     GWeatherApplet *gw_applet = info->applet;
-    
-    if (FALSE == info->valid)
-    {
-	    /* there has been an error during retrival
-	     * just update the fault counter
-	     */
-	    gw_fault_counter++;
-    }
-    else if ((TRUE == info->valid) ||
+   
+    /* Update timer */
+    if (gw_applet->timeout_tag > 0)
+        gtk_timeout_remove(gw_applet->timeout_tag);
+    if (gw_applet->gweather_pref.update_enabled)
+        gw_applet->timeout_tag =  
+        	gtk_timeout_add (
+			gw_applet->gweather_pref.update_interval * 1000,
+                        timeout_cb, gw_applet);
+ 
+    if ((TRUE == info->valid) ||
 	     (gw_fault_counter >= MAX_CONSECUTIVE_FAULTS))
     {
 	    gw_fault_counter = 0;
@@ -458,15 +460,6 @@ void update_finish (WeatherInfo *info)
 				    gw_applet->applet), s, NULL);
 	    g_free (s);
 	    
-	    /* Update timer */
-	    if (gw_applet->timeout_tag > 0)
-	        gtk_timeout_remove(gw_applet->timeout_tag);
-	    if (gw_applet->gweather_pref.update_enabled)
-	        gw_applet->timeout_tag =  
-	        	gtk_timeout_add (
-				gw_applet->gweather_pref.update_interval * 1000,
-	                        timeout_cb, gw_applet);
-
 	    /* Update dialog -- if one is present */
 	    gweather_dialog_update(gw_applet);
 	    
@@ -529,6 +522,13 @@ void update_finish (WeatherInfo *info)
 	    g_free (notification_message);
 	    g_free (notification_detail);
 #endif
+    }
+    else
+    {
+	    /* there has been an error during retrival
+	     * just update the fault counter
+	     */
+	    gw_fault_counter++;
     }
 }
 
