lib/async/http/protocol/http2/stream.rb in async-http-0.31.1 vs lib/async/http/protocol/http2/stream.rb in async-http-0.32.0

- old
+ new

@@ -54,11 +54,14 @@ chunk = @remainder @remainder = nil elsif chunk = @body.read # There was a new chunk of data to send else - @body = nil + if @body + @body.close + @body = nil + end # @body.read above might take a while and a stream reset might be received in the mean time. unless closed? send_data(nil, ::HTTP::Protocol::HTTP2::END_STREAM) end @@ -107,10 +110,10 @@ def receive_reset_stream(frame) error_code = super if @body - @body.stop(EOFError.new(error_code)) + @body.close(EOFError.new(error_code)) @body = nil end delegate.receive_reset_stream(self, error_code)