summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/base
diff options
context:
space:
mode:
authorkelvinp <kelvinp@chromium.org>2015-10-23 18:08:10 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-24 01:08:59 +0000
commit939f64cf8b666cb2c1dbb777193b4ee4f1e52236 (patch)
tree4c1326a62d75ba53ece6b935e3fa547862dafc09 /remoting/webapp/base
parent1d264d6e25dc627440335aef47e5938b4a537b14 (diff)
downloadchromium_src-939f64cf8b666cb2c1dbb777193b4ee4f1e52236.zip
chromium_src-939f64cf8b666cb2c1dbb777193b4ee4f1e52236.tar.gz
chromium_src-939f64cf8b666cb2c1dbb777193b4ee4f1e52236.tar.bz2
Fix zombie canceled sessions.
Our Telemetry data suggested that 12% of our canceled connections comes back to live (undergoes further state transitions). This CL fixes the problem by properly disconnecting the session if the user hit cancels before the session is created. BUG=547191 Review URL: https://codereview.chromium.org/1414193005 Cr-Commit-Position: refs/heads/master@{#355946}
Diffstat (limited to 'remoting/webapp/base')
-rw-r--r--remoting/webapp/base/js/client_session.js25
1 files changed, 13 insertions, 12 deletions
diff --git a/remoting/webapp/base/js/client_session.js b/remoting/webapp/base/js/client_session.js
index 7160f6f..f5bb9ba 100644
--- a/remoting/webapp/base/js/client_session.js
+++ b/remoting/webapp/base/js/client_session.js
@@ -291,19 +291,20 @@ remoting.ClientSession.prototype.disconnect = function(error) {
return;
}
+ console.assert(this.host_ != null, 'disconnect() is called before connect()');
this.sendIq_(
- '<cli:iq ' +
- 'to="' + this.host_.jabberId + '" ' +
- 'type="set" ' +
- 'id="session-terminate" ' +
- 'xmlns:cli="jabber:client">' +
- '<jingle ' +
- 'xmlns="urn:xmpp:jingle:1" ' +
- 'action="session-terminate" ' +
- 'sid="' + this.sessionId_ + '">' +
- '<reason><success/></reason>' +
- '</jingle>' +
- '</cli:iq>');
+ '<cli:iq ' +
+ 'to="' + this.host_.jabberId + '" ' +
+ 'type="set" ' +
+ 'id="session-terminate" ' +
+ 'xmlns:cli="jabber:client">' +
+ '<jingle ' +
+ 'xmlns="urn:xmpp:jingle:1" ' +
+ 'action="session-terminate" ' +
+ 'sid="' + this.sessionId_ + '">' +
+ '<reason><success/></reason>' +
+ '</jingle>' +
+ '</cli:iq>');
var state = error.isNone() ?
remoting.ClientSession.State.CLOSED :