From 0cd65fa1e01be369b270c72053cf21a3d6bcb45f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 19 Jul 2010 10:10:05 +0000 Subject: ensure stream response bodies get closed Some middlewares such as Clogger rely on wrapping the body having the close method called on it for logging. --- lib/rainbows/event_machine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/event_machine.rb') diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb index 0876ac9..4faa7a6 100644 --- a/lib/rainbows/event_machine.rb +++ b/lib/rainbows/event_machine.rb @@ -126,7 +126,7 @@ module Rainbows elsif st.socket? || st.pipe? chunk = stream_response_headers(status, headers) if headers m = chunk ? ResponseChunkPipe : ResponsePipe - return EM.watch(io, m, self, alive).notify_readable = true + return EM.watch(io, m, self, alive, body).notify_readable = true end # char or block device... WTF? fall through to body.each end -- cgit v1.2.3-24-ge0c7