From 7e2758692d70090b193f73212ae9cebc8fdcb7cb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 19 Jul 2010 10:09:59 +0000 Subject: event_machine: small simplification for async responses Extraneous returns are harder to follow. --- lib/rainbows/event_machine.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/rainbows/event_machine.rb') diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb index 9cfe481..3da6565 100644 --- a/lib/rainbows/event_machine.rb +++ b/lib/rainbows/event_machine.rb @@ -112,11 +112,8 @@ module Rainbows body.callback { quit } body.errback { quit } # async response, this could be a trickle as is in comet-style apps - if headers - headers[CONNECTION] = CLOSE - write(response_header(status, headers)) - end - return write_body_each(self, body) + headers[CONNECTION] = CLOSE if headers + alive = true elsif body.respond_to?(:to_path) io = body_to_io(body) st = io.stat -- cgit v1.2.3-24-ge0c7