diff options
author | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 04:05:51 +0000 |
---|---|---|
committer | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 04:05:51 +0000 |
commit | b7d5527c3806dc64d49f4f9ee32783622e126071 (patch) | |
tree | 5e6b7f0ed1bcd94df8853a48bb3638c896fbb2e3 | |
parent | 477cdbcbaad760bf53179098bdd3e89a941b2241 (diff) | |
download | chromium_src-b7d5527c3806dc64d49f4f9ee32783622e126071.zip chromium_src-b7d5527c3806dc64d49f4f9ee32783622e126071.tar.gz chromium_src-b7d5527c3806dc64d49f4f9ee32783622e126071.tar.bz2 |
Don't log 'connection failed' for session errors that occur after connection succeeds.
BUG=112150
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11412229
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170395 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/webapp/client_session.js | 13 | ||||
-rw-r--r-- | remoting/webapp/log_to_server.js | 3 | ||||
-rw-r--r-- | remoting/webapp/server_log_entry.js | 2 |
3 files changed, 13 insertions, 5 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); }; diff --git a/remoting/webapp/log_to_server.js b/remoting/webapp/log_to_server.js index 581a586..0ad8721 100644 --- a/remoting/webapp/log_to_server.js +++ b/remoting/webapp/log_to_server.js @@ -109,7 +109,8 @@ remoting.LogToServer.isStartOfSession = function(state) { */ remoting.LogToServer.isEndOfSession = function(state) { return ((state == remoting.ClientSession.State.CLOSED) || - (state == remoting.ClientSession.State.FAILED)); + (state == remoting.ClientSession.State.FAILED) || + (state == remoting.ClientSession.State.CONNECTION_DROPPED)); }; /** diff --git a/remoting/webapp/server_log_entry.js b/remoting/webapp/server_log_entry.js index 9cad50b..7256ba5 100644 --- a/remoting/webapp/server_log_entry.js +++ b/remoting/webapp/server_log_entry.js @@ -62,6 +62,8 @@ remoting.ServerLogEntry.getValueForSessionState = function(state) { return 'closed'; case remoting.ClientSession.State.FAILED: return 'connection-failed'; + case remoting.ClientSession.State.CONNECTION_DROPPED: + return 'connection-dropped'; default: return 'undefined-' + state; } |