Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fragmentation bugfix

  • Loading branch information...
commit 6914813a915298364d62880e6c16dd6f3020d999 1 parent 577bc76
@mplatov authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 lib/ws_proto_hybi07.rb
View
18 lib/ws_proto_hybi07.rb
@@ -70,11 +70,23 @@ def read_data(sock, buffer="")
fin, opcode, payload = read_frame(sock)
case opcode
when 0x0 # continuation frame
- return read_data(sock, buffer + payload)
+ if fin
+ return buffer + payload
+ else
+ return read_data(sock, buffer + payload)
+ end
when 0x1 # text frame
- return buffer + payload if fin
+ if fin
+ return buffer + payload
+ else
+ return read_data(sock, buffer + payload)
+ end
when 0x2 # bin frame
- return buffer + payload if fin
+ if fin
+ return buffer + payload
+ else
+ return read_data(sock, buffer + payload)
+ end
when 0x8 # connection close
@close_received = true
when 0x9 # ping
Please sign in to comment.
Something went wrong with that request. Please try again.