Skip to content

Commit

Permalink
This comment is just a note to understand where the problem is: we're…
Browse files Browse the repository at this point in the history
… not setting the buffer status properly and we do need to finish the session!
  • Loading branch information
botanicus committed Apr 16, 2012
1 parent e74c050 commit 38c2fa3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/sockjs/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,16 @@ def send_data(frame)
end

def finish
p [:buffer, @buffer]
frame = @buffer.to_frame
p [:frame, frame]
self.send_data(frame)
rescue SockJS::NoContentError => error
# Why there's no bloody content? That's not right, there should be a closing frame.
puts "~ finish: no content, setting the heartbeat timer."
self.set_heartbeat_timer(error.buffer)
ensure
@ws.close if frame and frame.match(/^c\[\d+,/)
# ensure
# @ws.close if frame and frame.match(/^c\[\d+,/)
end

def after_app_run
Expand All @@ -370,6 +374,10 @@ def after_app_run
end

def after_close
puts "~ after_close: calling #finish"
self.finish

puts "~ after_close: closing @ws and clearing @transport."
@ws.close
@transport = nil
end
Expand Down

0 comments on commit 38c2fa3

Please sign in to comment.