about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rainbows/coolio/client.rb7
-rw-r--r--lib/rainbows/ev_core.rb1
-rw-r--r--lib/rainbows/event_machine/client.rb2
3 files changed, 3 insertions, 7 deletions
diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb
index 6264df7..f44d2aa 100644
--- a/lib/rainbows/coolio/client.rb
+++ b/lib/rainbows/coolio/client.rb
@@ -105,17 +105,12 @@ class Rainbows::Coolio::Client < Coolio::IO
     @state = :headers
   end
 
-  def coolio_write_async_response(response)
-    write_async_response(response)
-    @deferred = nil
-  end
-
   def app_call
     KATO.delete(self)
     disable if enabled?
     @env[RACK_INPUT] = @input
     @env[REMOTE_ADDR] = @_io.kgio_addr
-    @env[ASYNC_CALLBACK] = method(:coolio_write_async_response)
+    @env[ASYNC_CALLBACK] = method(:write_async_response)
     status, headers, body = catch(:async) {
       APP.call(@env.merge!(RACK_DEFAULTS))
     }
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb
index 0bdaab3..a3bf50f 100644
--- a/lib/rainbows/ev_core.rb
+++ b/lib/rainbows/ev_core.rb
@@ -22,6 +22,7 @@ module Rainbows::EvCore
       alive = headers.include?(Content_Length) ||
               !!(%r{\Achunked\z}i =~ headers[Transfer_Encoding])
     end
+    @deferred = nil
     ev_write_response(status, headers, body, alive)
   end
 
diff --git a/lib/rainbows/event_machine/client.rb b/lib/rainbows/event_machine/client.rb
index c9f63a4..b75d7ee 100644
--- a/lib/rainbows/event_machine/client.rb
+++ b/lib/rainbows/event_machine/client.rb
@@ -40,7 +40,7 @@ class Rainbows::EventMachine::Client < EM::Connection
       APP.call(@env.merge!(RACK_DEFAULTS))
     }
 
-    (nil == status || -1 == status) or
+    (nil == status || -1 == status) ? @deferred = true :
       ev_write_response(status, headers, body, @hp.next?)
   end