about summary refs log tree commit homepage
path: root/lib/mongrel/camping.rb
diff options
context:
space:
mode:
authorwhy <why@19e92222-5c0b-0410-8929-a290d50e31e9>2006-04-11 03:24:53 +0000
committerwhy <why@19e92222-5c0b-0410-8929-a290d50e31e9>2006-04-11 03:24:53 +0000
commit001a467abdf9636cf23b786fd86e3404c955894d (patch)
tree9224b28f9a872614e42f8f57e9064b6adb6bfc48 /lib/mongrel/camping.rb
parentc8e46fcb007a8599cac1b3861744669b1eab9406 (diff)
downloadunicorn-001a467abdf9636cf23b786fd86e3404c955894d.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@158 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel/camping.rb')
-rw-r--r--lib/mongrel/camping.rb10
1 files changed, 7 insertions, 3 deletions
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