lib/async/http/body/fixed.rb in async-http-0.26.0 vs lib/async/http/body/fixed.rb in async-http-0.27.0
- old
+ new
@@ -36,11 +36,13 @@
def empty?
@remaining == 0
end
def stop(error)
- @stream.close
+ if @remaining != 0
+ @stream.close
+ end
end
def read
if @remaining > 0
if chunk = @stream.read_partial(@remaining)
@@ -72,9 +74,10 @@
def empty?
@stream.closed?
end
def stop(error)
+ # We can't really do anything in this case except close the connection.
@stream.close
end
def read
@stream.read_partial