Skip to content

Commit

Permalink
Moved to a -1 status code for async responses
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Aug 21, 2008
1 parent 231f251 commit 4b6f89c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/thin/connection.rb
Expand Up @@ -12,7 +12,7 @@ class Connection < EventMachine::Connection
include Logging

# This is a template async response. N.B. Can't use string for body on 1.9
AsyncResponse = [100, {}, []].freeze
AsyncResponse = [-1, {}, []].freeze

# Rack application (adapter) served by this connection.
attr_accessor :app
Expand Down Expand Up @@ -89,8 +89,8 @@ def post_process(result)
return unless result
result = result.to_a

# Status code 100 indicates that we're going to respond later (async).
return if result.first == 100
# Status code -1 indicates that we're going to respond later (async).
return if result.first == AsyncResponse.first

# Set the Content-Length header if possible
set_content_length(result) if need_content_length?(result)
Expand Down Expand Up @@ -128,7 +128,7 @@ def post_process(result)
@response.body.callback { terminate_request }
else
# Don't terminate the response if we're going async.
terminate_request unless result && result.first == 100
terminate_request unless result && result.first == AsyncResponse.first
end
end

Expand Down

0 comments on commit 4b6f89c

Please sign in to comment.