lib/em-websocket/framing03.rb in em-websocket-0.4.0 vs lib/em-websocket/framing03.rb in em-websocket-0.5.0
- old
+ new
@@ -4,10 +4,11 @@
module WebSocket
module Framing03
def initialize_framing
@data = ''
@application_data_buffer = '' # Used for MORE frames
+ @frame_type = nil
end
def process_data(newdata)
error = false
@@ -148,10 +149,10 @@
def type_to_opcode(frame_type)
FRAME_TYPES[frame_type] || raise("Unknown frame type")
end
def opcode_to_type(opcode)
- FRAME_TYPES_INVERSE[opcode] || raise(WSProtocolError, "Unknown opcode")
+ FRAME_TYPES_INVERSE[opcode] || raise(WSProtocolError, "Unknown opcode #{opcode}")
end
def data_frame?(type)
DATA_FRAMES.include?(type)
end