Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
for (var i = 0, transport; transport = transports[i]; i++) {
if (io.Transport[transport]
&& io.Transport[transport].check(this)
&& (!this.isXDomain() || io.Transport[transport].xdomainCheck())) {
&& (!this.isXDomain() || io.Transport[transport].xdomainCheck(this))) {
return new io.Transport[transport](this, this.sessionid);
}
}
Expand Down Expand Up @@ -359,10 +359,17 @@

Socket.prototype.disconnectSync = function () {
// ensure disconnection
var xhr = io.util.request()
, uri = this.resource + '/' + io.protocol + '/' + this.sessionid;

var xhr = io.util.request();
var uri = [
'http' + (this.options.secure ? 's' : '') + ':/'
, this.options.host + ':' + this.options.port
, this.options.resource
, io.protocol
, this.sessionid
].join('/');

xhr.open('GET', uri, true);
xhr.send(null);

// handle disconnection immediately
this.onDisconnect('booted');
Expand Down
4 changes: 2 additions & 2 deletions lib/transports/htmlfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@
* @api public
*/

HTMLFile.check = function () {
HTMLFile.check = function (socket) {
if (typeof window != "undefined" && 'ActiveXObject' in window){
try {
var a = new ActiveXObject('htmlfile');
return a && io.Transport.XHR.check();
return a && io.Transport.XHR.check(socket);
} catch(e){}
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions lib/transports/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@
* @api public
*/

XHR.xdomainCheck = function () {
return XHR.check(null, true);
XHR.xdomainCheck = function (socket) {
return XHR.check(socket, true);
};

})(
Expand Down