Skip to content

Commit

Permalink
Merge pull request socketio#975 from huancz/master
Browse files Browse the repository at this point in the history
fix issue socketio#961 - restore compatibility with earlier node releases (up to 0.4.x)
  • Loading branch information
rauchg committed Jul 31, 2012
2 parents 9dd8134 + a5c5c20 commit ca4e3f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ Manager.prototype.handleClient = function (data, req) {

Manager.prototype.generateId = function () {
var rand = new Buffer(15); // multiple of 3 for base64
if (!rand.writeInt32BE) {
return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString()
+ Math.abs(Math.random() * Math.random() * Date.now() | 0).toString();
}
this.sequenceNumber = (this.sequenceNumber + 1) | 0;
rand.writeInt32BE(this.sequenceNumber, 11);
if (crypto.randomBytes) {
Expand Down

0 comments on commit ca4e3f3

Please sign in to comment.