about summary refs log tree commit homepage
path: root/lib/unicorn/app/inetd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicorn/app/inetd.rb')
-rw-r--r--lib/unicorn/app/inetd.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/unicorn/app/inetd.rb b/lib/unicorn/app/inetd.rb
index f751a33..9bfa7cb 100644
--- a/lib/unicorn/app/inetd.rb
+++ b/lib/unicorn/app/inetd.rb
@@ -33,13 +33,12 @@ module Unicorn::App
         inp_pid = fork {
           input = env['rack.input']
           [ err_rd, out_rd ].each { |io| io.close }
-          buf = Unicorn::Z.dup
 
           # this is dependent on input.read having readpartial semantics:
-          while input.read(16384, buf)
+          buf = input.read(16384)
+          begin
             in_wr.write(buf)
-          end
-          in_wr.close
+          end while input.read(16384, buf)
         }
         in_wr.close
         self.pid_map = {