summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/client_session.js
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/webapp/client_session.js')
-rw-r--r--remoting/webapp/client_session.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 87151f9..6ae386c6 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -109,6 +109,7 @@ remoting.ClientSession = function(hostJid, hostPublicKey, sharedSecret,
// no corresponding plugin state transition.
/** @enum {number} */
remoting.ClientSession.State = {
+ CONNECTION_DROPPED: -4, // Succeeded, but subsequently closed with an error.
CREATED: -3,
BAD_PLUGIN_VERSION: -2,
UNKNOWN_PLUGIN_ERROR: -1,
@@ -553,10 +554,14 @@ remoting.ClientSession.prototype.setState_ = function(newState) {
// If connection errors are being suppressed from the logs, translate
// FAILED to CLOSED here. This ensures that the duration is still logged.
var state = this.state;
- if (this.state == remoting.ClientSession.State.FAILED &&
- !this.logErrors_) {
- console.log('Suppressing error.');
- state = remoting.ClientSession.State.CLOSED;
+ if (this.state == remoting.ClientSession.State.FAILED) {
+ if (oldState == remoting.ClientSession.State.CONNECTING &&
+ !this.logErrors_) {
+ console.log('Suppressing error.');
+ state = remoting.ClientSession.State.CLOSED;
+ } else if (oldState == remoting.ClientSession.State.CONNECTED) {
+ state = remoting.ClientSession.State.CONNECTION_DROPPED;
+ }
}
this.logToServer.logClientSessionStateChange(state, this.error, this.mode);
};