Skip to content

Commit

Permalink
Merge pull request socketio#983 from GICodeWarrior/parser-recursion
Browse files Browse the repository at this point in the history
Fix infinite recursion in Websocket parsers.
  • Loading branch information
rauchg committed Aug 6, 2012
2 parents 4164e3b + c218468 commit 8ca8990
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transports/websocket/hybi-07-12.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ Parser.prototype.add = function(data) {
var bufferForHandler = this.expectBuffer;
this.expectBuffer = null;
this.expectOffset = 0;
this.expectHandler.call(this, bufferForHandler);
process.nextTick(this.expectHandler.bind(this, bufferForHandler));
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/transports/websocket/hybi-16.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ Parser.prototype.add = function(data) {
var bufferForHandler = this.expectBuffer;
this.expectBuffer = null;
this.expectOffset = 0;
this.expectHandler.call(this, bufferForHandler);
process.nextTick(this.expectHandler.bind(this, bufferForHandler));
}
}

Expand Down

0 comments on commit 8ca8990

Please sign in to comment.