mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
socket: fixed disconnect xhr url and made it actually sync
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user