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

Commit

Permalink
Do not allow transitioning out of closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Anker committed Mar 27, 2015
1 parent 1a3061c commit 58e4f99
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 58e4f99

Please sign in to comment.