From 001a467abdf9636cf23b786fd86e3404c955894d Mon Sep 17 00:00:00 2001 From: why Date: Tue, 11 Apr 2006 03:24:53 +0000 Subject: For now, each content-type gets special treatment in the Camping handler. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@158 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel/camping.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/mongrel/camping.rb') diff --git a/lib/mongrel/camping.rb b/lib/mongrel/camping.rb index e305a9b..4a9418c 100644 --- a/lib/mongrel/camping.rb +++ b/lib/mongrel/camping.rb @@ -46,12 +46,14 @@ module Mongrel end end end - response.send_status((sendfile and File.size(sendfile) or clength)) - response.send_header if sendfile + response.send_status(File.size(sendfile)) + response.send_header response.send_file(sendfile) elsif controller.body.respond_to? :read + response.send_status(clength) + response.send_header while chunk = controller.body.read(16384) response.write(chunk) end @@ -59,7 +61,9 @@ module Mongrel controller.body.close end else - response.write(controller.body) + response.send_status(controller.body.length) + response.send_header + response.write(controller.body.to_s) end end end -- cgit v1.2.3-24-ge0c7