[tor-commits] [tor-launcher/master] Bug #10201: FF ESR 24 hangs during exit on Mac OS.

brade at torproject.org brade at torproject.org
Tue Dec 3 15:40:35 UTC 2013


commit 2089f899c0c72fc6ebcf1a210e8a0a5571f62cc1
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Tue Dec 3 10:38:50 2013 -0500

    Bug #10201: FF ESR 24 hangs during exit on Mac OS.
    
    Close Tor control port socket streams before closing socket.
    Avoid throw inside the event monitor's onInputStreamReady() function.
---
 src/components/tl-protocol.js |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/components/tl-protocol.js b/src/components/tl-protocol.js
index 2a68fbe..da56577 100644
--- a/src/components/tl-protocol.js
+++ b/src/components/tl-protocol.js
@@ -603,7 +603,14 @@ TorProtocolService.prototype =
       aConn = this.mControlConnection;
 
     if (aConn && aConn.socket)
-      aConn.socket.close(0);
+    {
+      if (aConn.binInStream)
+        aConn.binInStream.close();
+      if (aConn.binOutStream)
+        aConn.binOutStream.close();
+
+      aConn.socket.close(Cr.NS_OK);
+    }
 
     if (aConn == this.mControlConnection)
       this.mControlConnection = null;
@@ -1142,8 +1149,11 @@ TorProtocolService.prototype =
     {
       onInputStreamReady: function(aInStream)
       {
-        if (_this.mEventMonitorConnection.inStream != aInStream)
+        if (!_this.mEventMonitorConnection ||
+            (_this.mEventMonitorConnection.inStream != aInStream))
+        {
           return;
+        }
 
         var binStream = _this.mEventMonitorConnection.binInStream;
         var bytes = binStream.readBytes(binStream.available());



More information about the tor-commits mailing list