Skip to content

Commit

Permalink
Fix #91 - in some rare corner cases, for *-streaming closing might ha…
Browse files Browse the repository at this point in the history
…ve triggered null exception

Basically, when the close frame went above the data-per-straming connection limit.
  • Loading branch information
majek committed Nov 15, 2012
1 parent fc61ea1 commit 8f245ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/transport.coffee
Expand Up @@ -195,9 +195,11 @@ class Session
@readyState = Transport.CLOSING @readyState = Transport.CLOSING
@close_frame = closeFrame(status, reason) @close_frame = closeFrame(status, reason)
if @recv if @recv
# Go away. # Go away. doSendFrame can trigger didClose which can
# trigger unregister. Make sure the @recv is not null.
@recv.doSendFrame(@close_frame) @recv.doSendFrame(@close_frame)
@recv.didClose() if @recv
@recv.didClose()
if @recv if @recv
@unregister() @unregister()
return true return true
Expand Down

0 comments on commit 8f245ed

Please sign in to comment.