From 89f948aeaef34114ec61291ff8ffbebcf85a748e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 11 Jan 2011 16:01:20 -0800 Subject: event_machine: buffer reads when waiting for async.callback We cannot trigger on_read events and invoke the HTTP parser and modify @env while we're waiting for an application to run async.callback. We also need to clear (and *maybe* re-set) @deferred if we're writing from async.callback --- lib/rainbows/coolio/client.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/rainbows/coolio') 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)) } -- cgit v1.2.3-24-ge0c7