Skip to content

Commit

Permalink
Refactored handleRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Jan 3, 2012
1 parent 35fa0f7 commit fa7bea9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,17 @@ Server.prototype.handleRequest = function (req, res) {
if (!this.verify(req)) {
res.writeHead(500);
res.end();
return;
return this;
}

if (req.query.sid) {
this.clients[req.query.sid].transport().onRequest(req);
debug('seting new request for existing client');
this.clients[req.query.sid].transport.onRequest(req);
} else {
this.handshake(req);
this.handshake(req.query.transport, req);
}

return this;
};

/**
Expand Down

0 comments on commit fa7bea9

Please sign in to comment.