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

gk at torproject.org gk at torproject.org
Tue May 24 20:33:03 UTC 2016


commit 0f2d55e7426586d46e3d597b1e839908e2dd7c65
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/components/tl-process.js | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/components/tl-process.js b/src/components/tl-process.js
index aba6456..403bc56 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();
@@ -285,6 +303,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 tbb-commits mailing list