diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rainbows/revactor/tee_input.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/rainbows/revactor/tee_input.rb b/lib/rainbows/revactor/tee_input.rb index b8042ad..b34931f 100644 --- a/lib/rainbows/revactor/tee_input.rb +++ b/lib/rainbows/revactor/tee_input.rb @@ -21,17 +21,14 @@ module Rainbows # returns nil if reading from the input returns nil def tee(length, dst) unless parser.body_eof? - begin - if parser.filter_body(dst, buf << socket.read).nil? - @tmp.write(dst) - diff = dst.size - length - if diff > 0 - dst.replace(dst[0,length]) - @tmp.seek(-diff, IO::SEEK_CUR) - end - return dst + if parser.filter_body(dst, buf << socket.read).nil? + @tmp.write(dst) + diff = dst.size - length + if diff > 0 + dst.replace(dst[0,length]) + @tmp.seek(-diff, IO::SEEK_CUR) end - rescue EOFError + return dst end end finalize_input |