lib/protocol/http/body/readable.rb in protocol-http-0.30.0 vs lib/protocol/http/body/readable.rb in protocol-http-0.31.0

- old
+ new

@@ -55,9 +55,14 @@ # Write the body to the given stream. def call(stream) while chunk = self.read stream.write(chunk) + + # Flush the stream unless we are immediately expecting more data: + unless self.ready? + stream.flush + end end ensure stream.close end