[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-launcher/master] Bug 20429: Do not open progress window if TOR_SKIP_LAUNCH=1



commit c12d56470b7164c33b3cb2e48a90dc65151a9a26
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
Date:   Wed Oct 26 15:00:06 2016 -0400

    Bug 20429: Do not open progress window if TOR_SKIP_LAUNCH=1
    
    After saving tor settings, if TOR_SKIP_LAUNCH=1 or if
    extensions.torlauncher.start_tor is false, avoid opening the progress
    dialog to monitor bootstrap progress. This avoids displaying a progress
    window that will not make progress (and the situation was made worse by
    the fact that clicking Cancel set DisableNetwork=1).
    
    Also, leave the network settings dialog open if we fail to set
    DisableNetwork=0.
---
 src/chrome/content/network-settings.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/chrome/content/network-settings.js b/src/chrome/content/network-settings.js
index e0d7d1c..5df4e1e 100644
--- a/src/chrome/content/network-settings.js
+++ b/src/chrome/content/network-settings.js
@@ -1209,11 +1209,22 @@ function useSettings()
 {
   var settings = {};
   settings[kTorConfKeyDisableNetwork] = false;
-  setConfAndReportErrors(settings, null);
+  let didApply = setConfAndReportErrors(settings, null);
+  if (!didApply)
+    return;
 
   gProtocolSvc.TorSendCommand("SAVECONF");
   gTorProcessService.TorClearBootstrapError();
 
+  // If we are not responsible for starting tor we do not monitor bootstrap
+  // status, so just close this dialog and return rather than opening the
+  // progress dialog (which will make no progress).
+  if (!TorLauncherUtil.shouldStartAndOwnTor)
+  {
+    close();
+    return;
+  }
+
   gIsBootstrapComplete = gTorProcessService.TorIsBootstrapDone;
   if (!gIsBootstrapComplete)
     openProgressDialog();

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits