From 855c02a9720a17854a2f1c715efbe502cdba54e2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 12 Nov 2010 10:59:14 +0800 Subject: *_input: make life easier for subclasses/modules Avoid having specific knowledge of internals in TeeInput and instead move that to StreamInput when dealing with byte counts. This makes things easier for Rainbows! which will need to extends these classes. --- lib/unicorn/tee_input.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/unicorn/tee_input.rb') diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb index 74d9df6..0e937ff 100644 --- a/lib/unicorn/tee_input.rb +++ b/lib/unicorn/tee_input.rb @@ -81,10 +81,7 @@ class Unicorn::TeeInput < Unicorn::StreamInput # This takes zero arguments for strict Rack::Lint compatibility, # unlike IO#gets. def gets - @socket or return @tmp.gets - rv = super - # the $/.nil? case is implemented using read, so don't tee() again - $/.nil? ? rv : tee(rv) + @socket ? tee(super) : @tmp.gets end # :call-seq: -- cgit v1.2.3-24-ge0c7