[tor-commits] [tor-launcher/master] Bug 18947: not starting on OS X if put into /Applications

gk at torproject.org gk at torproject.org
Tue May 17 12:44:52 UTC 2016


commit 7ee11f5d012773445cc21a86bb1e8d423b15093d
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Mon May 16 10:48:51 2016 -0400

    Bug 18947: not starting on OS X if put into /Applications
    
    Display a better error message if tor exits and Tor Launcher was
    never able to establish a connection to the control port (pointing
    users to a possible error in their torrc may help them find and
    fix the startup problem themselves).
---
 src/chrome/locale/en/torlauncher.properties |  1 +
 src/components/tl-process.js                | 21 ++++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/chrome/locale/en/torlauncher.properties b/src/chrome/locale/en/torlauncher.properties
index 6b471a3..24bb4d6 100644
--- a/src/chrome/locale/en/torlauncher.properties
+++ b/src/chrome/locale/en/torlauncher.properties
@@ -3,6 +3,7 @@
 
 torlauncher.error_title=Tor Launcher
 
+torlauncher.tor_exited_during_startup=Tor exited during startup. This might be due to an error in your torrc file, a bug in Tor or another program on your system, or faulty hardware. Until you fix the underlying problem and restart Tor, Tor Browser will not start.
 torlauncher.tor_exited=Tor unexpectedly exited. This might be due to a bug in Tor itself, another program on your system, or faulty hardware. Until you restart Tor, the Tor Browser will not able to reach any websites. If the problem persists, please send a copy of your Tor Log to the support team.
 torlauncher.tor_exited2=Restarting Tor will not close your browser tabs.
 torlauncher.tor_controlconn_failed=Could not connect to Tor control port.
diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index 7daa31f..ba50310 100644
--- a/src/components/tl-process.js
+++ b/src/components/tl-process.js
@@ -150,8 +150,25 @@ TorProcessService.prototype =
       {
         this.mProtocolSvc.TorCleanupConnection();
 
-        var s = TorLauncherUtil.getLocalizedString("tor_exited") + "\n\n"
+        let s;
+        if (!this.mDidConnectToTorControlPort)
+        {
+          // The "tor_exited_during_startup" property string was added in
+          // May 2016. If it is available, we use it; otherwise, we fall back
+          // to the older "tor_exited" message (below). Once this new string
+          // has been translated into all of the languages that we ship, we
+          // can simplify this code.
+          let key = "tor_exited_during_startup";
+          s = TorLauncherUtil.getLocalizedString(key)
+          if (s == key)  // No string found for key.
+            s = undefined;
+        }
+
+        if (!s)
+        {
+          s = TorLauncherUtil.getLocalizedString("tor_exited") + "\n\n"
                 + TorLauncherUtil.getLocalizedString("tor_exited2");
+        }
         TorLauncherLogger.log(4, s);
         var defaultBtnLabel = TorLauncherUtil.getLocalizedString("restart_tor");
         var cancelBtnLabel = "OK";
@@ -178,6 +195,7 @@ TorProcessService.prototype =
         var haveConnection = this.mProtocolSvc.TorHaveControlConnection();
         if (haveConnection)
         {
+          this.mDidConnectToTorControlPort = true;
           this.mControlConnTimer = null;
           this.mTorProcessStatus = this.kStatusRunning;
           this.mProtocolSvc.TorStartEventMonitor();
@@ -282,6 +300,7 @@ TorProcessService.prototype =
 
   // Private Member Variables ////////////////////////////////////////////////
   mTorProcessStatus: 0,  // kStatusUnknown
+  mDidConnectToTorControlPort: false,  // Have we ever made a connection?
   mIsBootstrapDone: false,
   mBootstrapErrorOccurred: false,
   mIsQuitting: false,



More information about the tor-commits mailing list