Bug 1059001 - Part 5: Reset connection options before connecting. r=paul

This commit is contained in:
J. Ryan Stinnett 2014-12-10 20:55:52 -06:00
Родитель f314c713cf
Коммит a2087e8769
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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;