lib/async/http/body/chunked.rb in async-http-0.31.1 vs lib/async/http/body/chunked.rb in async-http-0.32.0

- old
+ new

@@ -34,12 +34,17 @@ def empty? @finished end - def stop(error) - @protocol.close - @finished = true + def close(error = nil) + # We only close the connection if we haven't completed reading the entire body: + unless @finished + @protocol.close + @finished = true + end + + super end def read return nil if @finished