From 2e913054b36848a05f7ba06c3accbe164c666708 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 16 Jul 2009 01:13:33 -0700 Subject: move all #gets logic to tee_input out of chunked_reader This simplifies chunked_reader substantially with a slight increase in tee_input complexity. This is beneficial because chunked_reader is more complex to begin with and more likely to experience correctness issues. --- lib/unicorn/chunked_reader.rb | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'lib/unicorn/chunked_reader.rb') diff --git a/lib/unicorn/chunked_reader.rb b/lib/unicorn/chunked_reader.rb index 539b350..b813da6 100644 --- a/lib/unicorn/chunked_reader.rb +++ b/lib/unicorn/chunked_reader.rb @@ -32,23 +32,6 @@ module Unicorn buf end - def gets - line = nil - begin - line = readpartial(Const::CHUNK_SIZE) - begin - if line.sub!(%r{\A(.*?#{$/})}, Z) - @chunk_left += line.size - @buf = @buf ? (line << @buf) : line - return $1.dup - end - line << readpartial(Const::CHUNK_SIZE) - end while true - rescue EOFError - return line - end - end - private def last_block(max = nil) -- cgit v1.2.3-24-ge0c7