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

Commit

Permalink
Rename to :ready
Browse files Browse the repository at this point in the history
  • Loading branch information
therabidbanana committed Jul 26, 2013
1 parent 113b637 commit 8f0c5b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/reel/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ def detach
end

# Reset the current request state
def reset_request(state = :standard)
def reset_request(state = :ready)
@request_state = state
@current_request = nil
@parser.reset
end

def readpartial(size = @buffer_size)
raise StateError, "can't read in the '#{@request_state}' request state" unless @request_state == :standard
raise StateError, "can't read in the '#{@request_state}' request state" unless @request_state == :ready
@parser.readpartial(size)
end

Expand All @@ -65,7 +65,7 @@ def request

case req
when Request
@request_state = :standard
@request_state = :ready
@keepalive = false if req[CONNECTION] == CLOSE || req.version == HTTP_VERSION_1_0
@current_request = req
when WebSocket
Expand Down Expand Up @@ -118,7 +118,7 @@ def respond(response, headers_or_body = {}, body = nil)
@keepalive = false
ensure
if @keepalive
reset_request(:standard)
reset_request(:ready)
else
@socket.close unless @socket.closed?
reset_request(:closed)
Expand Down

0 comments on commit 8f0c5b8

Please sign in to comment.