about summary refs log tree commit homepage
path: root/lib/rainbows/event_machine.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/event_machine.rb')
-rw-r--r--lib/rainbows/event_machine.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb
index 4faa7a6..696f5a0 100644
--- a/lib/rainbows/event_machine.rb
+++ b/lib/rainbows/event_machine.rb
@@ -121,7 +121,10 @@ module Rainbows
           if st.file?
             write(response_header(status, headers)) if headers
             @body = stream = stream_file_data(body.to_path)
-            stream.callback { quit } unless alive
+            stream.callback do
+              body.close if body.respond_to?(:close)
+              quit unless alive
+            end
             return
           elsif st.socket? || st.pipe?
             chunk = stream_response_headers(status, headers) if headers