From 4b6f89c75b9fe8282b7fec561be1a0e563fad952 Mon Sep 17 00:00:00 2001 From: raggi Date: Thu, 21 Aug 2008 17:45:59 +0100 Subject: [PATCH] Moved to a -1 status code for async responses --- lib/thin/connection.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/thin/connection.rb b/lib/thin/connection.rb index a812b860..ac1cc563 100644 --- a/lib/thin/connection.rb +++ b/lib/thin/connection.rb @@ -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 @@ -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) @@ -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