From 1b7b4d160610dd538eee624ef8eb8c6ed301a2b5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2009 00:23:18 +0000 Subject: tee_input: don't shadow struct members It's confusing when a local variable reuses the same name as a struct member. --- lib/unicorn/tee_input.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb index eeed7ba..69397c0 100644 --- a/lib/unicorn/tee_input.rb +++ b/lib/unicorn/tee_input.rb @@ -144,23 +144,23 @@ module Unicorn self.socket = nil end - # tee()s into +buf+ until it is of +length+ bytes (or until + # tee()s into +dst+ until it is of +length+ bytes (or until # we've reached the Content-Length of the request body). - # Returns +buf+ (the exact object, not a duplicate) + # Returns +dst+ (the exact object, not a duplicate) # To continue supporting applications that need near-real-time # streaming input bodies, this is a no-op for # "Transfer-Encoding: chunked" requests. - def ensure_length(buf, length) + def ensure_length(dst, length) # @size is nil for chunked bodies, so we can't ensure length for those # since they could be streaming bidirectionally and we don't want to # block the caller in that case. - return buf if buf.nil? || @size.nil? + return dst if dst.nil? || @size.nil? - while buf.size < length && tee(length - buf.size, @buf2) - buf << @buf2 + while dst.size < length && tee(length - dst.size, @buf2) + dst << @buf2 end - buf + dst end end -- cgit v1.2.3-24-ge0c7