about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-14 00:23:18 +0000
committerEric Wong <normalperson@yhbt.net>2009-11-13 16:33:27 -0800
commit1b7b4d160610dd538eee624ef8eb8c6ed301a2b5 (patch)
treeb4ca5272e83c2ffaaa12626b1f9f252beb6e829d
parent7e5942c3de1d79a6597443db5158b74c5253f6d3 (diff)
downloadunicorn-1b7b4d160610dd538eee624ef8eb8c6ed301a2b5.tar.gz
It's confusing when a local variable reuses the same name
as a struct member.
-rw-r--r--lib/unicorn/tee_input.rb14
1 files 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