lib/async/http/body/inflate.rb in async-http-0.37.2 vs lib/async/http/body/inflate.rb in async-http-0.37.3

- old
+ new

@@ -31,17 +31,18 @@ end def read return if @stream.finished? + # The stream might have been closed while waiting for the chunk to come in. if chunk = super @input_length += chunk.bytesize # It's possible this triggers the stream to finish. chunk = @stream.inflate(chunk) @output_length += chunk.bytesize - else + elsif !@stream.closed? chunk = @stream.finish @output_length += chunk.bytesize end \ No newline at end of file