diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-11-13 16:41:10 +0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-11-13 16:41:10 +0800 |
commit | 17a734a9f6ccea8c969a574f09b5d8dd3d568a9c (patch) | |
tree | 30c3b8cccaa7b4807d105feebf6766166ad8e6b8 /lib/unicorn/tee_input.rb | |
parent | 855c02a9720a17854a2f1c715efbe502cdba54e2 (diff) | |
download | unicorn-17a734a9f6ccea8c969a574f09b5d8dd3d568a9c.tar.gz |
It's possible for an application to call size after it has read a few bytes/lines, so do not screw up a user's read offset when consuming input.
Diffstat (limited to 'lib/unicorn/tee_input.rb')
-rw-r--r-- | lib/unicorn/tee_input.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb index 0e937ff..ee3effd 100644 --- a/lib/unicorn/tee_input.rb +++ b/lib/unicorn/tee_input.rb @@ -43,8 +43,9 @@ class Unicorn::TeeInput < Unicorn::StreamInput # specified +length+ in a loop until it returns +nil+. def size @len and return @len + pos = @bytes_read consume! - @tmp.rewind + @tmp.pos = pos @len = @bytes_read end |