mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
bug 1063648 - don't cache transport. r=jryans
This commit is contained in:
parent
a779a752ee
commit
45422188ae
@ -193,8 +193,8 @@ Connection.prototype = {
|
||||
return;
|
||||
}
|
||||
if (!this._client) {
|
||||
this._transport = transport;
|
||||
if (this._transport) {
|
||||
this._customTransport = transport;
|
||||
if (this._customTransport) {
|
||||
this.log("connecting (custom transport)");
|
||||
} else {
|
||||
this.log("connecting to " + this.host + ":" + this.port);
|
||||
@ -223,12 +223,15 @@ Connection.prototype = {
|
||||
},
|
||||
|
||||
_clientConnect: function () {
|
||||
if (!this._transport) {
|
||||
let transport;
|
||||
if (this._customTransport) {
|
||||
transport = this._customTransport;
|
||||
} else {
|
||||
if (!this.host) {
|
||||
this._transport = DebuggerServer.connectPipe();
|
||||
transport = DebuggerServer.connectPipe();
|
||||
} else {
|
||||
try {
|
||||
this._transport = debuggerSocketConnect(this.host, this.port);
|
||||
transport = debuggerSocketConnect(this.host, this.port);
|
||||
} catch (e) {
|
||||
// In some cases, especially on Mac, the openOutputStream call in
|
||||
// debuggerSocketConnect may throw NS_ERROR_NOT_INITIALIZED.
|
||||
@ -240,7 +243,7 @@ Connection.prototype = {
|
||||
}
|
||||
}
|
||||
}
|
||||
this._client = new DebuggerClient(this._transport);
|
||||
this._client = new DebuggerClient(transport);
|
||||
this._client.addOneTimeListener("closed", this._onDisconnected);
|
||||
this._client.connect(this._onConnected);
|
||||
},
|
||||
@ -259,6 +262,7 @@ Connection.prototype = {
|
||||
|
||||
_onDisconnected: function() {
|
||||
this._client = null;
|
||||
this._customTransport = null;
|
||||
|
||||
if (this._status == Connection.Status.CONNECTING && this.keepConnecting) {
|
||||
setTimeout(() => this._clientConnect(), 100);
|
||||
|
Loading…
Reference in New Issue
Block a user