about summary refs log tree commit homepage
path: root/lib/unicorn/app/exec_cgi.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-27 20:48:20 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-27 20:48:20 -0700
commit79c270990ec3a657c23510ee4f2f7f2b4c2c748f (patch)
treee760846dc5446b4a903cd7c7c8c6756fac8f6b54 /lib/unicorn/app/exec_cgi.rb
parent3b0fcbf8baafbb88b2f15631b949fde9c8acff3b (diff)
downloadunicorn-79c270990ec3a657c23510ee4f2f7f2b4c2c748f.tar.gz
We've started using magic comments to ensure any strings we
create are binary instead.  Additionally, ensure we create any
StringIO objects with an explicit string (which default to
binary) to ensure the StringIO object is binary.  This is
because StringIO.new (with no arguments) will always use the
process-wide default encoding since it does not know about
magic comments (and couldn't, really...)
Diffstat (limited to 'lib/unicorn/app/exec_cgi.rb')
-rw-r--r--lib/unicorn/app/exec_cgi.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicorn/app/exec_cgi.rb b/lib/unicorn/app/exec_cgi.rb
index 4f9216b..2262e4c 100644
--- a/lib/unicorn/app/exec_cgi.rb
+++ b/lib/unicorn/app/exec_cgi.rb
@@ -125,10 +125,10 @@ module Unicorn::App
       else
         tmp = Unicorn::Util.tmpio
 
-        buf = Unicorn::Z.dup
-        while inp.read(CHUNK_SIZE, buf)
+        buf = inp.read(CHUNK_SIZE)
+        begin
           tmp.syswrite(buf)
-        end
+        end while inp.read(CHUNK_SIZE, buf)
         tmp.sysseek(0)
         tmp
       end