Permalink
Browse files

This comment is just a note to understand where the problem is: we're…

… not setting the buffer status properly and we do need to finish the session!
  • Loading branch information...
1 parent e74c050 commit 38c2fa34799f963e7164765cd1586da46db739ea @botanicus botanicus committed Apr 16, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/sockjs/session.rb
View
@@ -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
@@ -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

0 comments on commit 38c2fa3

Please sign in to comment.