Commit 2089f899 authored by Kathleen Brade's avatar Kathleen Brade
Browse files

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.
parent 0dbee8e0
...@@ -603,7 +603,14 @@ TorProtocolService.prototype = ...@@ -603,7 +603,14 @@ TorProtocolService.prototype =
aConn = this.mControlConnection; aConn = this.mControlConnection;
if (aConn && aConn.socket) 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) if (aConn == this.mControlConnection)
this.mControlConnection = null; this.mControlConnection = null;
...@@ -1142,8 +1149,11 @@ TorProtocolService.prototype = ...@@ -1142,8 +1149,11 @@ TorProtocolService.prototype =
{ {
onInputStreamReady: function(aInStream) onInputStreamReady: function(aInStream)
{ {
if (_this.mEventMonitorConnection.inStream != aInStream) if (!_this.mEventMonitorConnection ||
(_this.mEventMonitorConnection.inStream != aInStream))
{
return; return;
}
var binStream = _this.mEventMonitorConnection.binInStream; var binStream = _this.mEventMonitorConnection.binInStream;
var bytes = binStream.readBytes(binStream.available()); var bytes = binStream.readBytes(binStream.available());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment