Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Commit

Permalink
Merge pull request #190 from zanker/master
Browse files Browse the repository at this point in the history
Do not allow transitioning out of closed
  • Loading branch information
//de committed Apr 11, 2015
2 parents 6b9a364 + 58e4f99 commit 3f90e8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/reel/request/state_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ def initialize(socket)
@hijacked = true
end

state :closed do
# FSM fails open for valid transitions
# Set an empty array to disallow transitioning out of closed
state :closed, :to => [] do
@socket.close unless @hijacked || @socket.closed?
end
end
end
end
end

0 comments on commit 3f90e8a

Please sign in to comment.