зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1059001 - Part 5: Reset connection options before connecting. r=paul
This commit is contained in:
Родитель
f314c713cf
Коммит
a2087e8769
|
@ -346,6 +346,8 @@ let AppManager = exports.AppManager = {
|
|||
this.connection.on(Connection.Events.CONNECTED, onConnectedOrDisconnected);
|
||||
this.connection.on(Connection.Events.DISCONNECTED, onConnectedOrDisconnected);
|
||||
try {
|
||||
// Reset the connection's state to defaults
|
||||
this.connection.resetOptions();
|
||||
this.selectedRuntime.connect(this.connection).then(
|
||||
() => {},
|
||||
deferred.reject.bind(deferred));
|
||||
|
|
|
@ -116,8 +116,7 @@ function Connection(host, port) {
|
|||
this._onDisconnected = this._onDisconnected.bind(this);
|
||||
this._onConnected = this._onConnected.bind(this);
|
||||
this._onTimeout = this._onTimeout.bind(this);
|
||||
this.keepConnecting = false;
|
||||
this.encryption = false;
|
||||
this.resetOptions();
|
||||
}
|
||||
|
||||
Connection.Status = {
|
||||
|
@ -180,6 +179,11 @@ Connection.prototype = {
|
|||
this.emit(Connection.Events.PORT_CHANGED);
|
||||
},
|
||||
|
||||
resetOptions() {
|
||||
this.keepConnecting = false;
|
||||
this.encryption = false;
|
||||
},
|
||||
|
||||
disconnect: function(force) {
|
||||
if (this.status == Connection.Status.DESTROYED) {
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче