Skip to content

Commit

Permalink
Fixed engine.io for 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Jun 5, 2012
1 parent 1254c2c commit ce99f05
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/engine.io.js
Expand Up @@ -115,7 +115,14 @@ exports.attach = function (server, options) {
}

// cache and clean up listeners
var oldListeners = server.listeners('request');
var listeners = server.listeners('request')
, oldListeners = []

// copy the references onto a new array for node >=0.7
for (var i = 0, l = listeners.length; i < l; i++) {
oldListeners[i] = listeners[i];
}

server.removeAllListeners('request');

server.on('close', function () {
Expand Down

0 comments on commit ce99f05

Please sign in to comment.