lib/async/http/body/fixed.rb in async-http-0.24.3 vs lib/async/http/body/fixed.rb in async-http-0.25.0

- old
+ new

@@ -35,10 +35,14 @@ def empty? @remaining == 0 end + def stop(error) + @stream.close + end + def read if @remaining > 0 if chunk = @stream.read_partial(@remaining) @remaining -= chunk.bytesize @@ -67,11 +71,15 @@ def empty? @stream.closed? end + def stop(error) + @stream.close + end + def read - @stream.read unless @stream.closed? + @stream.read_partial end def join read end