lib/rainbows/fiber/io.rb in rainbows-0.95.1 vs lib/rainbows/fiber/io.rb in rainbows-0.96.0
- old
+ new
@@ -22,14 +22,14 @@
to_io.respond_to?(:peeraddr) ? to_io.peeraddr : [ LOCALHOST ]
end
# for wrapping output response bodies
def each(&block)
- begin
- yield readpartial(16384)
+ if buf = readpartial(16384)
+ yield buf
+ yield buf while readpartial(16384, buf)
+ end
rescue EOFError
- break
- end while true
self
end
def close
fileno = to_io.fileno