Skip to content

Commit

Permalink
Release 0.9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Nov 2, 2012
1 parent 2d9ffc3 commit 110d7c4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
9 changes: 9 additions & 0 deletions History.md
@@ -1,4 +1,13 @@

0.9.11 / 2012-11-02
===================

* Enable use of 'xhr' transport in Node.js
* Fix the problem with disconnecting xhr-polling users
* Add should to devDependencies
* Prefer XmlHttpRequest if CORS is available
* Make client compatible with AMD loaders.

0.9.10 / 2012-08-10
===================

Expand Down
43 changes: 26 additions & 17 deletions dist/socket.io.js
Expand Up @@ -262,7 +262,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);

util.request = function (xdomain) {

if (xdomain && 'undefined' != typeof XDomainRequest) {
if (xdomain && 'undefined' != typeof XDomainRequest && !util.ua.hasCORS) {
return new XDomainRequest();
}

Expand Down Expand Up @@ -318,7 +318,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*
* @api public
*/

util.merge = function merge (target, additional, deep, lastseen) {
var seen = lastseen || []
, depth = typeof deep == 'undefined' ? 2 : deep
Expand All @@ -343,7 +343,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*
* @api public
*/

util.mixin = function (ctor, ctor2) {
util.merge(ctor.prototype, ctor2.prototype);
};
Expand Down Expand Up @@ -391,7 +391,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
}

return ret;
}
};

/**
* Array indexOf compatibility.
Expand All @@ -401,8 +401,8 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*/

util.indexOf = function (arr, o, i) {
for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;

for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;
i < j && arr[i] !== o; i++) {}

return j <= i ? -1 : i;
Expand Down Expand Up @@ -667,7 +667,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
return exports.JSON = {
parse: nativeJSON.parse
, stringify: nativeJSON.stringify
}
};
}

var JSON = exports.JSON = {};
Expand Down Expand Up @@ -1273,7 +1273,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);

Transport.prototype.heartbeats = function () {
return true;
}
};

/**
* Handles the response from the server. When a new response is received
Expand All @@ -1286,8 +1286,8 @@ var io = ('undefined' === typeof module ? {} : module.exports);

Transport.prototype.onData = function (data) {
this.clearCloseTimeout();
// If the connection in currently open (or in a reopening state) reset the close

// If the connection in currently open (or in a reopening state) reset the close
// timeout since we have just received data. This check is necessary so
// that we don't reset the timeout on an explicitly disconnected connection.
if (this.socket.connected || this.socket.connecting || this.socket.reconnecting) {
Expand Down Expand Up @@ -1339,7 +1339,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*
* @api private
*/

Transport.prototype.setCloseTimeout = function () {
if (!this.closeTimeout) {
var self = this;
Expand Down Expand Up @@ -1372,7 +1372,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
Transport.prototype.onConnect = function () {
this.socket.onConnect();
return this;
}
};

/**
* Clears close timeout
Expand Down Expand Up @@ -1423,7 +1423,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
Transport.prototype.onHeartbeat = function (heartbeat) {
this.packet({ type: 'heartbeat' });
};

/**
* Called when the transport opens.
*
Expand Down Expand Up @@ -3235,7 +3235,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
var request = io.util.request(xdomain),
usesXDomReq = (global.XDomainRequest && request instanceof XDomainRequest),
socketProtocol = (socket && socket.options && socket.options.secure ? 'https:' : 'http:'),
isXProtocol = (socketProtocol != global.location.protocol);
isXProtocol = (global.location && socketProtocol != global.location.protocol);
if (request && !(usesXDomReq && isXProtocol)) {
return true;
}
Expand Down Expand Up @@ -3532,12 +3532,18 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
function onload () {
this.onload = empty;
this.onerror = empty;
self.retryCounter = 1;
self.onData(this.responseText);
self.get();
};

function onerror () {
self.onClose();
self.retryCounter ++;
if(!self.retryCounter || self.retryCounter > 3) {
self.onClose();
} else {
self.get();
}
};

this.xhr = this.request();
Expand Down Expand Up @@ -3751,7 +3757,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho

this.socket.setBuffer(true);
};

/**
* Creates a new JSONP poll that can be used to listen
* for messages from the Socket.IO server.
Expand All @@ -3778,7 +3784,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
self.onClose();
};

var insertAt = document.getElementsByTagName('script')[0]
var insertAt = document.getElementsByTagName('script')[0];
insertAt.parentNode.insertBefore(script, insertAt);
this.script = script;

Expand Down Expand Up @@ -3859,4 +3865,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
, this
);

if (typeof define === "function" && define.amd) {
define([], function () { return io; });
}
})();
2 changes: 1 addition & 1 deletion dist/socket.io.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "socket.io-client"
, "description": "Socket.IO client for the browser and node.js"
, "version": "0.9.10"
, "version": "0.9.11"
, "main" : "./lib/io.js"
, "browserify": "./dist/socket.io.js"
, "homepage": "http://socket.io"
Expand All @@ -28,8 +28,8 @@
, "express": "2.5.x"
, "jade": "*"
, "stylus": "*"
, "socket.io": "0.9.10"
, "socket.io-client": "0.9.10"
, "socket.io": "0.9.11"
, "socket.io-client": "0.9.11"
, "should": "*"
}
, "engines": { "node": ">= 0.4.0" }
Expand Down

0 comments on commit 110d7c4

Please sign in to comment.