[maemo-commits] [maemo-commits] r13436 - in projects/haf/trunk/osso-gnome-vfs2/debian: . patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Aug 28 16:50:14 EEST 2007
Author: martyn
Date: 2007-08-28 16:50:08 +0300 (Tue, 28 Aug 2007)
New Revision: 13436

Modified:
   projects/haf/trunk/osso-gnome-vfs2/debian/changelog
   projects/haf/trunk/osso-gnome-vfs2/debian/patches/35-NB63225-gconf-race-condition.patch
Log:
Fixes: NB#66755, proxy_init cb not getting called in time


Modified: projects/haf/trunk/osso-gnome-vfs2/debian/changelog
===================================================================
--- projects/haf/trunk/osso-gnome-vfs2/debian/changelog	2007-08-28 13:17:38 UTC (rev 13435)
+++ projects/haf/trunk/osso-gnome-vfs2/debian/changelog	2007-08-28 13:50:08 UTC (rev 13436)
@@ -1,3 +1,9 @@
+osso-gnome-vfs2 (2.16.3-1osso27~unreleased) unstable; urgency=low
+
+  * Fixes: NB#66755, proxy_init cb not getting called in time
+	
+ -- Martyn Russell <martyn at imendio.com>  Fri,  1 Sep 2007 17:00:00 +0100
+
 osso-gnome-vfs2 (2.16.3-1osso26) unstable; urgency=low
 
   * Fixes: NB#66140, gnome-vfs http module leak

Modified: projects/haf/trunk/osso-gnome-vfs2/debian/patches/35-NB63225-gconf-race-condition.patch
===================================================================
--- projects/haf/trunk/osso-gnome-vfs2/debian/patches/35-NB63225-gconf-race-condition.patch	2007-08-28 13:17:38 UTC (rev 13435)
+++ projects/haf/trunk/osso-gnome-vfs2/debian/patches/35-NB63225-gconf-race-condition.patch	2007-08-28 13:50:08 UTC (rev 13436)
@@ -1,35 +1,71 @@
---- ../orig/osso-gnome-vfs-2.16.3/modules/http-proxy.c	2007-01-09 11:32:55.000000000 +0000
-+++ modules/http-proxy.c	2007-08-03 16:26:13.000000000 +0100
-@@ -524,7 +524,8 @@ notify_gconf_value_changed(GConfClient *
+--- modules/http-proxy.c	2007-08-27 13:05:18.000000000 +0300
++++ modules/http-proxy.c	2007-08-27 12:55:28.000000000 +0300
+@@ -52,7 +52,7 @@
+ 
+ /* Global variables used by the HTTP proxy config */
+ static GConfClient *gl_client = NULL;
+-static GMutex *gl_mutex = NULL;	/* This mutex protects preference values
++G_LOCK_DEFINE_STATIC(gl_mutex);	/* This mutex protects preference values
+ 				 * and ensures serialization of authentication
+ 				 * hook callbacks       
+ 				 */
+@@ -247,7 +247,7 @@
+ 
+     ret = proxy_should_for_hostname (toplevel_uri->host_name);
+ 
+-    g_mutex_lock (gl_mutex);
++    G_LOCK(gl_mutex);
+ 
+     if (ret && gl_http_proxy != NULL) {
+ 	ret = host_port_from_string(gl_http_proxy, &(proxy_info->host),
+@@ -263,7 +263,7 @@
+ 	ret = FALSE;
      }
+ 
+-    g_mutex_unlock(gl_mutex);
++    G_UNLOCK(gl_mutex);
+ 
+     return ret;
  }
+@@ -499,7 +499,7 @@
+ 	|| strcmp(key, KEY_GCONF_HTTP_PROXY_PORT) == 0) {
+ 	gboolean use_proxy_value;
  
--void proxy_init(void)
-+static gboolean 
-+proxy_init_cb (gpointer user_data)
- {
-     GError *gconf_error = NULL;
-     gboolean use_proxy;
-@@ -578,6 +579,22 @@ void proxy_init(void)
-     } else {
+-	g_mutex_lock(gl_mutex);
++	G_LOCK(gl_mutex);
+ 
+ 	/* Check and see if we are using the proxy */
+ 	use_proxy_value =
+@@ -507,20 +507,20 @@
+ 				  KEY_GCONF_USE_HTTP_PROXY, NULL);
+ 	construct_gl_http_proxy(use_proxy_value);
+ 
+-	g_mutex_unlock(gl_mutex);
++	G_UNLOCK(gl_mutex);
+     } else if (strcmp(key, KEY_GCONF_HTTP_AUTH_USER) == 0
+ 	       || strcmp(key, KEY_GCONF_HTTP_AUTH_PW) == 0
+ 	       || strcmp(key, KEY_GCONF_HTTP_USE_AUTH) == 0) {
+ 	gboolean use_proxy_auth;
+ 
+-	g_mutex_lock(gl_mutex);
++	G_LOCK(gl_mutex);
+ 
+ 	use_proxy_auth =
+ 	    gconf_client_get_bool(gl_client,
+ 				  KEY_GCONF_HTTP_USE_AUTH, NULL);
  	set_proxy_auth(use_proxy_auth);
+ 
+-	g_mutex_unlock(gl_mutex);
++	G_UNLOCK(gl_mutex);
      }
-+
-+    return FALSE;
-+}
-+
-+void proxy_init(void)
-+{
-+    /* This fixes NB#63225:
-+     *
-+     * This is a work around to a race condition caused by the GConf
-+     * API being used in a thread, which shouldn't happen since GConf
-+     * isn't thread safe. We use g_idle_add() here to do the GConf
-+     * calls from the main thread. Note, this is fine where we have a
-+     * main loop, but in cases where we don't have a main loop this
-+     * work arround is not effective. 
-+     */
-+    g_idle_add (proxy_init_cb, NULL);
  }
  
+@@ -532,7 +532,6 @@
+     gboolean use_proxy_auth;
  
+     gl_client = gconf_client_get_default();
+-    gl_mutex = g_mutex_new();
+ 
+     gconf_client_add_dir(gl_client, PATH_GCONF_GNOME_VFS,
+ 			 GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
+


More information about the maemo-commits mailing list