about summary refs log tree commit homepage
path: root/lib/unicorn/chunked_reader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicorn/chunked_reader.rb')
-rw-r--r--lib/unicorn/chunked_reader.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/unicorn/chunked_reader.rb b/lib/unicorn/chunked_reader.rb
index 41193d0..40d421d 100644
--- a/lib/unicorn/chunked_reader.rb
+++ b/lib/unicorn/chunked_reader.rb
@@ -6,22 +6,13 @@ module Unicorn; end
 module Unicorn
   class ChunkedReader
 
-    def initialize
-      @input = @buf = nil
-      @chunk_left = 0
-    end
-
-    def reopen(input, buf)
-      buf ||= Z.dup
-      buf.force_encoding(Encoding::BINARY) if buf.respond_to?(:force_encoding)
+    def initialize(input, buf)
       @input, @buf = input, buf
+      @chunk_left = 0
       parse_chunk_header
-      self
     end
 
     def readpartial(max, buf = Z.dup)
-      buf.force_encoding(Encoding::BINARY) if buf.respond_to?(:force_encoding)
-
       while @input && @chunk_left <= 0 && ! parse_chunk_header
         @buf << @input.readpartial(Const::CHUNK_SIZE, buf)
       end