88b9e56
# HG changeset patch
88b9e56
# Parent 3523e7f7a89d7933c5f1dc8f5f22559b48ec44c4
88b9e56
diff --git a/netwerk/base/src/nsIOService.cpp b/netwerk/base/src/nsIOService.cpp
88b9e56
--- a/netwerk/base/src/nsIOService.cpp
88b9e56
+++ b/netwerk/base/src/nsIOService.cpp
88b9e56
@@ -818,17 +818,18 @@ nsIOService::PrefsChanged(nsIPrefBranch 
88b9e56
         if (NS_SUCCEEDED(rv)) {
88b9e56
             if (mSocketTransportService)
88b9e56
                 mSocketTransportService->SetAutodialEnabled(enableAutodial);
88b9e56
         }
88b9e56
     }
88b9e56
 
88b9e56
     if (!pref || strcmp(pref, MANAGE_OFFLINE_STATUS_PREF) == 0) {
88b9e56
         bool manage;
88b9e56
-        if (NS_SUCCEEDED(prefs->GetBoolPref(MANAGE_OFFLINE_STATUS_PREF,
88b9e56
+        if (mNetworkLinkServiceInitialized &&
88b9e56
+            NS_SUCCEEDED(prefs->GetBoolPref(MANAGE_OFFLINE_STATUS_PREF,
88b9e56
                                             &manage)))
88b9e56
             SetManageOfflineStatus(manage);
88b9e56
     }
88b9e56
 
88b9e56
     if (!pref || strcmp(pref, NECKO_BUFFER_CACHE_COUNT_PREF) == 0) {
88b9e56
         int32_t count;
88b9e56
         if (NS_SUCCEEDED(prefs->GetIntPref(NECKO_BUFFER_CACHE_COUNT_PREF,
88b9e56
                                            &count)))
88b9e56
@@ -928,16 +929,20 @@ nsIOService::Observe(nsISupports *subjec
88b9e56
     } 
88b9e56
     else if (!strcmp(topic, kProfileDoChange)) { 
88b9e56
         if (data && NS_LITERAL_STRING("startup").Equals(data)) {
88b9e56
             // Lazy initialization of network link service (see bug 620472)
88b9e56
             InitializeNetworkLinkService();
88b9e56
             // Set up the initilization flag regardless the actuall result.
88b9e56
             // If we fail here, we will fail always on.
88b9e56
             mNetworkLinkServiceInitialized = true;
88b9e56
+            // And now reflect the preference setting
88b9e56
+            nsCOMPtr<nsIPrefBranch> prefBranch;
88b9e56
+            GetPrefBranch(getter_AddRefs(prefBranch));
88b9e56
+            PrefsChanged(prefBranch, MANAGE_OFFLINE_STATUS_PREF);
88b9e56
         }
88b9e56
     }
88b9e56
     else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
88b9e56
         // Remember we passed XPCOM shutdown notification to prevent any
88b9e56
         // changes of the offline status from now. We must not allow going
88b9e56
         // online after this point.
88b9e56
         mShutdown = true;
88b9e56