GNOME Bugzilla – Bug 686226
NMRemoteSettings: fix async initialization
Last modified: 2012-10-16 18:32:31 UTC
If async GetProperties completed before the GetConnections, init_left would be 0 and thus we never connected to connections-read, causing us to terminate initialization before connections were actually read.
Created attachment 226564 [details] [review] NMRemoteSettings: fix async initialization
Comment on attachment 226564 [details] [review] NMRemoteSettings: fix async initialization >@@ -739,6 +744,7 @@ name_owner_changed (DBusGProxy *proxy, > g_source_remove (priv->fetch_id); > > if (new_owner && strlen (new_owner) > 0) { >+ priv->fetching = TRUE; This doesn't seem necessary; fetching is only checked during async init. >+ priv->inited = TRUE; > init_async_complete (init_data); >+ priv->inited = TRUE; > init_async_complete (init_data); You could just set priv->inited in init_async_complete(); it doesn't matter whether or not inited gets set TRUE in the case where init_async() fails, because the caller is required to destroy the object immediately in that case anyway. Can you make sure the patch still works with those changes? >diff --git a/src/nm-device.c b/src/nm-device.c unrelated...
(In reply to comment #2) > (From update of attachment 226564 [details] [review]) > >@@ -739,6 +744,7 @@ name_owner_changed (DBusGProxy *proxy, > > g_source_remove (priv->fetch_id); > > > > if (new_owner && strlen (new_owner) > 0) { > >+ priv->fetching = TRUE; > > This doesn't seem necessary; fetching is only checked during async init. In theory though, name_owner_changed could be emitted before the connections were read completely, and thus start a new round of fetching. > > > >diff --git a/src/nm-device.c b/src/nm-device.c > > unrelated... Take it as a hint :)
(In reply to comment #3) > Take it as a hint :) why, what's wrong with the current IP?
(In reply to comment #4) > (In reply to comment #3) > > Take it as a hint :) > > why, what's wrong with the current IP? Nothing, except that it's the same in every NetworkManager, so when I need two levels of NATs (say, one pc connected to paid wifi, sharing via ethernet, the other creating a wifi hotspot for more people to join) I need to hand patch NM. I would be happier if it was random or configurable somehow, but I understand my configuration is a bit esoteric.
Created attachment 226574 [details] [review] NMRemoteSettings: fix async initialization If async GetProperties completed before the GetConnections, init_left would be 0 and thus we never connected to connections-read, causing us to terminate initialization before connections were actually read.
Attachment 226574 [details] pushed as 246633a - NMRemoteSettings: fix async initialization