Skip to content

Commit

Permalink
fixed parse frame bug
Browse files Browse the repository at this point in the history
  • Loading branch information
masuidrive committed Nov 16, 2011
1 parent abdab2d commit 01d5595
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/websocket-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,12 @@ var parse_frame = function(buffer, size, socket) {
var offset = 2;
switch(len) {
case 126:
var bytesRead = socket.read(buffer, 0, 2);
len = Utils.read_2byte(buffer, offset);
offset += 2;
break;

case 127:
// too large
var bytesRead = socket.read(buffer, 0, 8);
// too large I felt
len = Utils.read_8byte(buffer, offset);
offset += 8;
break;
Expand Down

0 comments on commit 01d5595

Please sign in to comment.