socket: fixed disconnect xhr url and made it actually sync

This commit is contained in:
Guillermo Rauch
2012-08-01 15:10:09 -07:00
parent 46a4b9ff9f
commit cffb4ebdbd

View File

@@ -52,8 +52,7 @@
if (this.options['sync disconnect on unload'] &&
(!this.isXDomain() || io.util.ua.hasCORS)) {
var self = this;
io.util.on(global, 'unload', function () {
io.util.on(global, 'beforeunload', function () {
self.disconnectSync();
}, false);
}
@@ -362,11 +361,12 @@
, this.options.host + ':' + this.options.port
, this.options.resource
, io.protocol
, ''
, this.sessionid
].join('/') + '?disconnect';
].join('/') + '/?disconnect=1';
xhr.open('GET', uri, true);
xhr.send(null);
xhr.open('GET', uri, false);
xhr.send(null);
// handle disconnection immediately
this.onDisconnect('booted');