Skip to content

Commit

Permalink
fixed cross-port bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericz committed Mar 12, 2011
1 parent a09d77d commit b67f083
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
6 changes: 5 additions & 1 deletion lib/now.js
Expand Up @@ -38,6 +38,10 @@ window.onload = function(){

now = nowCore.scopes[SERVER_ID];

var ready = nowOld.ready;

delete nowOld.ready;

nowUtil.initializeScope(nowOld, socket);

nowUtil.addChildrenToBlacklist(nowCore.watchersBlacklist[SERVER_ID], nowOld, "now");
Expand All @@ -52,7 +56,7 @@ window.onload = function(){


// Call the ready handlers
now.ready();
ready();
});

var socket = new io.Socket('**SERVER**', {port: **PORT**});
Expand Down
10 changes: 0 additions & 10 deletions lib/nowServerLib.js
Expand Up @@ -100,16 +100,6 @@ function serveFile(filename, request, response){
}












exports.handleNewConnection = function(client){

client.on('message', function(message){
Expand Down
4 changes: 1 addition & 3 deletions lib/nowUtil.js
Expand Up @@ -236,9 +236,7 @@ nowUtil.mergeScopes = function(current, incoming) {
}
nowUtil.mergeScopes(current[prop], incoming[prop]);
} else {
if(!current.hasOwnProperty(prop)){
current[prop] = incoming[prop];
}
current[prop] = incoming[prop];
}
}
}
Expand Down

0 comments on commit b67f083

Please sign in to comment.