Skip to content

Commit

Permalink
Merge pull request #17 from masamitsu-murase/modify_code_handling
Browse files Browse the repository at this point in the history
Fix handling close code
  • Loading branch information
imanel committed Jul 2, 2013
2 parents bd5c049 + 2c4eed2 commit 4b528c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/websocket/frame/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Frame
class Base
include ExceptionHandler

attr_reader :data, :type, :version
attr_reader :type, :version
attr_accessor :data, :code

# Initialize frame
# @param args [Hash] Arguments for frame
Expand Down
6 changes: 3 additions & 3 deletions lib/websocket/frame/handler/handler05.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ module Handler
class Handler05 < Handler04

def encode_frame
if @code
@frame.data = Data.new([@code].pack('n') + @frame.data.to_s)
@code = nil
if @frame.code
@frame.data = Data.new([@frame.code].pack('n') + @frame.data.to_s)
@frame.code = nil
end
super
end
Expand Down

0 comments on commit 4b528c6

Please sign in to comment.